Windows third party dead code removed. 93/229893/4
authorVictor Cebollada <v.cebollada@samsung.com>
Mon, 6 Apr 2020 08:53:35 +0000 (09:53 +0100)
committerVictor Cebollada <v.cebollada@samsung.com>
Thu, 9 Apr 2020 09:17:59 +0000 (10:17 +0100)
* GetRealFileMode() removed
* GetRealName() code moved to CustomFile.cpp

Change-Id: Ibb35df4f77c7d9173d1212b56ab8c81687bd6740
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
third-party/file.list
third-party/windows-platform/Win32File/CustomFile.cpp
third-party/windows-platform/Win32File/GetRealFileName.cpp [deleted file]

index 56c0799..955fc9e 100644 (file)
@@ -1,13 +1,12 @@
 
 
 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
-  
 )
 
 
@@ -30,7 +29,6 @@ SET( adaptor_windows_platform_src_files
     ${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
index 5992bf7..1cfb627 100644 (file)
@@ -17,24 +17,39 @@ extern int OriginalFSeek( const void *fp, int offset, int origin );
 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
 {
@@ -42,7 +57,7 @@ FILE* FOpen( const char *name, const char *mode )
 {
   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)
     {
diff --git a/third-party/windows-platform/Win32File/GetRealFileName.cpp b/third-party/windows-platform/Win32File/GetRealFileName.cpp
deleted file mode 100644 (file)
index 433a89c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#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;
-  }
-}
-}