Przeglądaj źródła

DecodeBase64(String): make arg const ref

1vanK 3 lat temu
rodzic
commit
c1797b25a9

+ 4 - 4
Source/Urho3D/AngelScript/Generated_GlobalFunctions.cpp

@@ -8,8 +8,8 @@
 namespace Urho3D
 {
 
-// Vector<unsigned char> DecodeBase64(String encodedString) | File: ../Core/StringUtils.h
-static CScriptArray* Vectorlesunsignedspchargre_DecodeBase64_String(String encodedString)
+// Vector<unsigned char> DecodeBase64(const String& encodedString) | File: ../Core/StringUtils.h
+static CScriptArray* Vectorlesunsignedspchargre_DecodeBase64_constspStringamp(const String& encodedString)
 {
     Vector<unsigned char> result = DecodeBase64(encodedString);
     return VectorToArray(result, "Array<uint8>");
@@ -100,8 +100,8 @@ void ASRegisterGeneratedGlobalFunctions(asIScriptEngine* engine)
     // i32 CountSetBits(u32 value) | File: ../Math/MathDefs.h
     engine->RegisterGlobalFunction("int CountSetBits(uint)", AS_FUNCTIONPR(CountSetBits, (u32), i32), AS_CALL_CDECL);
 
-    // Vector<unsigned char> DecodeBase64(String encodedString) | File: ../Core/StringUtils.h
-    engine->RegisterGlobalFunction("Array<uint8>@ DecodeBase64(String)", AS_FUNCTION(Vectorlesunsignedspchargre_DecodeBase64_String), AS_CALL_CDECL);
+    // Vector<unsigned char> DecodeBase64(const String& encodedString) | File: ../Core/StringUtils.h
+    engine->RegisterGlobalFunction("Array<uint8>@ DecodeBase64(const String&in)", AS_FUNCTION(Vectorlesunsignedspchargre_DecodeBase64_constspStringamp), AS_CALL_CDECL);
 
     // unsigned DecompressData(void* dest, const void* src, unsigned destSize) | File: ../IO/Compression.h
     // Error: type "void*" can not automatically bind

+ 1 - 1
Source/Urho3D/Core/StringUtils.cpp

@@ -773,7 +773,7 @@ static inline bool IsBase64(char c) {
     return (isalnum(c) || (c == '+') || (c == '/'));
 }
 
-Vector<unsigned char> DecodeBase64(String encodedString)
+Vector<unsigned char> DecodeBase64(const String& encodedString)
 {
     int inLen = encodedString.Length();
     int i = 0;

+ 1 - 1
Source/Urho3D/Core/StringUtils.h

@@ -117,7 +117,7 @@ URHO3D_API unsigned ToLower(unsigned ch);
 /// Convert a memory size into a formatted size string, of the style "1.5 Mb".
 URHO3D_API String GetFileSizeString(unsigned long long memorySize);
 /// Decode a base64-encoded string into buffer.
-URHO3D_API Vector<unsigned char> DecodeBase64(String encodedString);
+URHO3D_API Vector<unsigned char> DecodeBase64(const String& encodedString);
 /// Parse type from a C string.
 template <class T> T FromString(const char* source);