Patch level : 2.0 nopatch

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
Aggiunte alcune funzioncide di xvt per parsare/splittare il path


git-svn-id: svn://10.65.10.50/trunk@11043 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-04-22 14:01:47 +00:00
parent 9aab6a9dd5
commit 4ef1edaea9
2 changed files with 39 additions and 0 deletions

View File

@ -2295,6 +2295,43 @@ void xvt_font_unmap(XVT_FNTID font_id)
// File system
///////////////////////////////////////////////////////////
BOOLEAN xvt_fsys_build_pathname(char *mbs, const char *volname, const char *dirname, const char *leafroot, const char *leafext, const char* /* leafvers */)
{
#ifdef WIN32
_makepath(mbs, volname, dirname, leafroot, leafext);
#else
*msb = '\0';
if (dirname && *dirname)
strcpy(mbs, dirname);
if (leafroot && *leafroot)
{
if (*leafroot != '/' && *leafroot != '\\')
strcat(mbs, "/");
strcat(mbs, leafroot);
}
if (leafext && *leafext)
{
if (*leafext != '.')
strcat(mbs, ".");
strcat(mbs, leafext);
}
#endif
return TRUE;
}
BOOLEAN xvt_fsys_parse_pathname(const char *mbs, char *volname, char *dirname, char *leafroot, char *leafext, char *leafvers)
{
wxString volume, path, file, ext;
wxFileName::SplitPath(mbs, &volume, &path, &file, &ext);
if (volname) strcpy(volname, volume);
if (dirname) strcpy(dirname, path);
if (leafroot) strcpy(leafroot, file);
if (leafext) strcpy(leafext, ext);
if (leafvers) strcpy(leafvers, ""); // TBI put here last change date/time?
return TRUE;
}
BOOLEAN xvt_fsys_convert_dir_to_str(DIRECTORY *dirp, char *path, int sz_path)
{
wxStrncpy(path, dirp->path, sz_path);

View File

@ -124,11 +124,13 @@ void xvt_font_set_style(XVT_FNTID font_id, XVT_FONT_STYLE_MASK ma
long xvt_font_serialize(XVT_FNTID font_id, char *buf, long max_buf);
void xvt_font_unmap(XVT_FNTID font_id);
BOOLEAN xvt_fsys_build_pathname(char *mbs, const char *volname, const char *dirname, const char *leafroot, const char *leafext, const char *leafvers);
BOOLEAN xvt_fsys_convert_dir_to_str(DIRECTORY *dirp, char *path, int sz_path);
BOOLEAN xvt_fsys_convert_str_to_dir(const char *path, DIRECTORY *dirp);
BOOLEAN xvt_fsys_get_dir(DIRECTORY *dirp);
void xvt_fsys_get_default_dir(DIRECTORY *dirp);
SLIST xvt_fsys_list_files(char *type, char *pat, BOOLEAN dirs);
BOOLEAN xvt_fsys_parse_pathname (const char *mbs, char *volname, char *dirname, char *leafroot, char *leafext, char *leafvers);
void xvt_fsys_restore_dir();
void xvt_fsys_save_dir();
BOOLEAN xvt_fsys_set_dir(DIRECTORY *dirp);