Windows third party dead code removed. 11/230611/1
authorVictor Cebollada <v.cebollada@samsung.com>
Mon, 6 Apr 2020 08:53:35 +0000 (09:53 +0100)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 13 Apr 2020 04:28:02 +0000 (13:28 +0900)
* 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 56c0799abf2d9ff57b4b449e2cbef109c2eb0ebc..955fc9eaaac6cd9181aa3e972e8ab3f5365f30b2 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 5992bf798ceed1ba31313560bfc47395a27fb44a..1cfb62722c0604f241b6833033264f47c32f527b 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;
-  }
-}
-}