瀏覽代碼

Merge branch 'master' into dev

dmuratshin 9 年之前
父節點
當前提交
0094eb7a22
共有 3 個文件被更改,包括 16 次插入0 次删除
  1. 8 0
      oxygine/src/json/jsoncpp.cpp
  2. 7 0
      oxygine/src/utils/stringUtils.cpp
  3. 1 0
      oxygine/src/utils/stringUtils.h

+ 8 - 0
oxygine/src/json/jsoncpp.cpp

@@ -3103,6 +3103,7 @@ namespace Json
             default:
             default:
                 JSON_FAIL_MESSAGE("Type is not convertible to string");
                 JSON_FAIL_MESSAGE("Type is not convertible to string");
         }
         }
+		return "";
     }
     }
 
 
 #ifdef JSON_USE_CPPTL
 #ifdef JSON_USE_CPPTL
@@ -3138,6 +3139,7 @@ namespace Json
                 break;
                 break;
         }
         }
         JSON_FAIL_MESSAGE("Value is not convertible to Int.");
         JSON_FAIL_MESSAGE("Value is not convertible to Int.");
+		return 0;
     }
     }
 
 
     Value::UInt Value::asUInt() const
     Value::UInt Value::asUInt() const
@@ -3162,6 +3164,7 @@ namespace Json
                 break;
                 break;
         }
         }
         JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
         JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
+		return 0;
     }
     }
 
 
 #if defined(JSON_HAS_INT64)
 #if defined(JSON_HAS_INT64)
@@ -3187,6 +3190,7 @@ namespace Json
                 break;
                 break;
         }
         }
         JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
         JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
+		return 0;
     }
     }
 
 
     Value::UInt64 Value::asUInt64() const
     Value::UInt64 Value::asUInt64() const
@@ -3210,6 +3214,7 @@ namespace Json
                 break;
                 break;
         }
         }
         JSON_FAIL_MESSAGE("Value is not convertible to UInt64.");
         JSON_FAIL_MESSAGE("Value is not convertible to UInt64.");
+		return 0;
     }
     }
 #endif // if defined(JSON_HAS_INT64)
 #endif // if defined(JSON_HAS_INT64)
 
 
@@ -3253,6 +3258,7 @@ namespace Json
                 break;
                 break;
         }
         }
         JSON_FAIL_MESSAGE("Value is not convertible to double.");
         JSON_FAIL_MESSAGE("Value is not convertible to double.");
+		return 0.0;
     }
     }
 
 
     float Value::asFloat() const
     float Value::asFloat() const
@@ -3277,6 +3283,7 @@ namespace Json
                 break;
                 break;
         }
         }
         JSON_FAIL_MESSAGE("Value is not convertible to float.");
         JSON_FAIL_MESSAGE("Value is not convertible to float.");
+		return 0.0f;
     }
     }
 
 
     bool Value::asBool() const
     bool Value::asBool() const
@@ -3298,6 +3305,7 @@ namespace Json
                 break;
                 break;
         }
         }
         JSON_FAIL_MESSAGE("Value is not convertible to bool.");
         JSON_FAIL_MESSAGE("Value is not convertible to bool.");
+		return false;
     }
     }
 
 
     bool Value::isConvertibleTo(ValueType other) const
     bool Value::isConvertibleTo(ValueType other) const

+ 7 - 0
oxygine/src/utils/stringUtils.cpp

@@ -190,6 +190,13 @@ namespace oxygine
             *dest = 0;
             *dest = 0;
         }
         }
 
 
+        std::string normalize(const std::string& pth)
+        {
+            char path[512];
+            normalize(pth.c_str(), path);
+            return path;
+        }
+
         std::string extractFileName(const std::string& path)
         std::string extractFileName(const std::string& path)
         {
         {
             size_t pos = path.find_last_of("\\/") + 1;
             size_t pos = path.find_last_of("\\/") + 1;

+ 1 - 0
oxygine/src/utils/stringUtils.h

@@ -19,6 +19,7 @@ namespace oxygine
         void splitExt(const char* src, char* destHead, char* destTail);
         void splitExt(const char* src, char* destHead, char* destTail);
 
 
         void normalize(const char* src, char* dest);
         void normalize(const char* src, char* dest);
+        std::string normalize(const std::string& pth);
 
 
         /**some/file/path.png   ->  path.png*/
         /**some/file/path.png   ->  path.png*/
         std::string extractFileName(const std::string& path);
         std::string extractFileName(const std::string& path);