SET( static_libraries_glyphy_src_files
- ${adaptor_thirdparty_dir}/glyphy/glyphy-arcs.cc
- ${adaptor_thirdparty_dir}/glyphy/glyphy-blob-impl.cc
- ${adaptor_thirdparty_dir}/glyphy/glyphy-extents.cc
- ${adaptor_thirdparty_dir}/glyphy/glyphy-outline.cc
- ${adaptor_thirdparty_dir}/glyphy/glyphy-sdf.cc
+ ${adaptor_thirdparty_dir}/glyphy/glyphy-arcs.cc
+ ${adaptor_thirdparty_dir}/glyphy/glyphy-blob-impl.cc
+ ${adaptor_thirdparty_dir}/glyphy/glyphy-extents.cc
+ ${adaptor_thirdparty_dir}/glyphy/glyphy-outline.cc
+ ${adaptor_thirdparty_dir}/glyphy/glyphy-sdf.cc
${adaptor_thirdparty_dir}/glyphy/vector-font-cache.cpp
-
)
${adaptor_thirdparty_dir}/windows-platform/network.cpp
${adaptor_thirdparty_dir}/windows-platform/thread.cpp
${adaptor_thirdparty_dir}/windows-platform/Win32File/CustomFile.cpp
- ${adaptor_thirdparty_dir}/windows-platform/Win32File/GetRealFileName.cpp
${adaptor_thirdparty_dir}/windows-platform/Win32File/MemFile.cpp
${adaptor_thirdparty_dir}/windows-platform/Win32File/OriginalFile.cpp
)
\ No newline at end of file
extern int OriginalFTell( const void *fp );
extern bool OriginalFEof( const void *fp );
-namespace std
+namespace
{
-int GetRealFileMode(const char *path, int _Mode)
+std::string GetRealName(const char* name)
{
- std::string strPath = path;
-
- if ((std::ios::in | std::ios::ate == _Mode) && strPath.find(".json") != std::string::npos)
+ if (nullptr != name && '*' == name[0])
{
- return std::ios::in | std::ios::binary | std::ios::ate;
+ std::string envName;
+
+ const char *p = name + 1;
+
+ while (0 != *p && '*' != *p)
+ {
+ envName.push_back(*p);
+ p++;
+ }
+
+ p++;
+
+ char *envValue = std::getenv(envName.c_str());
+
+ std::string realName;
+ realName = "";
+ realName += envValue;
+ realName += p;
+
+ return realName;
}
else
{
- return _Mode;
+ return std::string(name);
}
}
-
-extern const char* GetRealName(const char *name);
-}
+} // namespace
namespace CustomFile
{
{
if( NULL != name && '*' == name[0] )
{
- std::string realName = std::GetRealName( name );
+ std::string realName = GetRealName( name );
FILE* ret = (FILE*)OriginalFOpen( realName.c_str(), mode );
if (NULL == ret)
{
+++ /dev/null
-#include <string>
-
-namespace std
-{
-const char* GetRealName( const char *name )
-{
- if( NULL != name && '*' == name[0] )
- {
- string envName;
-
- const char *p = name + 1;
-
- while( 0 != *p && '*' != *p )
- {
- envName.push_back( *p );
- p++;
- }
-
- p++;
-
- char *envValue = std::getenv( envName.c_str() );
-
- static std::string realName;
- realName = "";
- realName += envValue;
- realName += p;
-
- return realName.c_str();
- }
- else
- {
- return name;
- }
-}
-}