Esempio n. 1
0
        /*----< extract category name from a FileRef object >----------*/

        /*
         *  FileRefs have the form category/filename.
         *  This function extracts the category.
         */
        public DirName extractCategory(FileRef fileRef)
        {
            int pos = fileRef.IndexOf('/');

            if (pos == -1)
            {
                return("");
            }
            return(fileRef.Substring(0, pos));
        }
Esempio n. 2
0
        /*----< extract file name from FileRef object >----------------*/

        /*
         *  FileRefs have the form category/filename.
         *  This function extracts the filename.
         */
        public FileName extractFileName(FileRef fileRef)
        {
            int pos = fileRef.IndexOf('/');

            if (pos == -1)
            {
                return("");
            }
            return(fileRef.Substring(pos + 1));
        }