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:
parent
36dc72cf04
commit
36312e9779
@ -276,3 +276,19 @@ ILibrary *LibrarySystem::OpenLibrary(const char *path, char *error, size_t err_m
|
|||||||
|
|
||||||
return new CLibrary(lib);
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -58,6 +58,7 @@ public:
|
|||||||
virtual bool IsPathFile(const char *path);
|
virtual bool IsPathFile(const char *path);
|
||||||
virtual bool IsPathDirectory(const char *path);
|
virtual bool IsPathDirectory(const char *path);
|
||||||
virtual void GetPlatformError(char *error, size_t err_max);
|
virtual void GetPlatformError(char *error, size_t err_max);
|
||||||
|
virtual void PathFormat(char *buffer, size_t len, const char *fmt, ...);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern LibrarySystem g_LibSys;
|
extern LibrarySystem g_LibSys;
|
||||||
|
Loading…
Reference in New Issue
Block a user