/*----< 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)); }
/*----< 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)); }