Added path formating to LibrarySystem so we don't have to rely on g_SMAPI

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40211
This commit is contained in:
David Anderson 2006-12-13 11:13:50 +00:00
parent 36dc72cf04
commit 36312e9779
2 changed files with 17 additions and 0 deletions

View File

@ -276,3 +276,19 @@ ILibrary *LibrarySystem::OpenLibrary(const char *path, char *error, size_t err_m
return new CLibrary(lib);
}
void LibrarySystem::PathFormat(char *buffer, size_t len, const char *fmt, ...)
{
va_list ap;
va_start(ap,fmt);
size_t mylen = vsnprintf(buffer, len, fmt, ap);
va_end(ap);
for (size_t i=0; i<mylen; i++)
{
if (buffer[i] == PLATFORM_SEP_ALTCHAR)
{
buffer[i] = PLATFORM_SEP_CHAR;
}
}
}

View File

@ -58,6 +58,7 @@ public:
virtual bool IsPathFile(const char *path);
virtual bool IsPathDirectory(const char *path);
virtual void GetPlatformError(char *error, size_t err_max);
virtual void PathFormat(char *buffer, size_t len, const char *fmt, ...);
};
extern LibrarySystem g_LibSys;