diff --git a/Src/IACore/imp/inl/IACore/StreamReader/StreamReader.inl b/Src/IACore/imp/inl/IACore/StreamReader/StreamReader.inl index aaca260..0f31f2e 100644 --- a/Src/IACore/imp/inl/IACore/StreamReader/StreamReader.inl +++ b/Src/IACore/imp/inl/IACore/StreamReader/StreamReader.inl @@ -62,7 +62,7 @@ namespace ia VOID MemoryStreamReader::Read(IN INT64 size, IN PUINT8 buffer) { IA_RELEASE_ASSERT((m_cursor + size) <= m_buffer.size()); - memcpy_s(buffer, size, &m_buffer[m_cursor], size); + memcpy(buffer, &m_buffer[m_cursor], size); m_cursor += size; } @@ -113,7 +113,7 @@ namespace ia FileStreamReader::FileStreamReader(IN PCCHAR filePath) { - fopen_s(&m_filePtr, filePath, "rb"); + m_filePtr = fopen(filePath, "rb"); if (!m_filePtr) THROW_FILE_OPEN_READ(filePath); } diff --git a/Src/IACore/imp/inl/IACore/string/interface/string.interface.inl b/Src/IACore/imp/inl/IACore/string/interface/string.interface.inl index e2d4257..35bae62 100644 --- a/Src/IACore/imp/inl/IACore/string/interface/string.interface.inl +++ b/Src/IACore/imp/inl/IACore/string/interface/string.interface.inl @@ -16,7 +16,7 @@ #pragma once -#include +#include namespace ia { @@ -96,6 +96,10 @@ namespace ia INLINE StringT slice(IN size_type start, IN size_type end, IN size_type stride = 1) CONST; INLINE StringT slice(IN const_iterator first, IN const_iterator last, IN size_type stride = 1) CONST; + INLINE Vector split(IN CHAR delimiter); + template + INLINE STATIC StringT join(IN CONST Vector<_value_type>& values, IN CHAR delimiter); + public: VOID operator+=(IN char_type v) { diff --git a/Src/IACore/imp/inl/IACore/string/string.inl b/Src/IACore/imp/inl/IACore/string/string.inl index 3cb69af..02dfb19 100644 --- a/Src/IACore/imp/inl/IACore/string/string.inl +++ b/Src/IACore/imp/inl/IACore/string/string.inl @@ -228,6 +228,32 @@ namespace ia return { Base::m_data + insert_at + n }; } + define_member_function(Vector<__ia__identifier>, split, IN CHAR delimiter) + { + Vector<__ia__identifier> result; + + SIZE_T t = 0; + for(SIZE_T i = 0; i < length(); i++) + { + if(Base::m_data[i] == delimiter) + { + result.pushBack(slice(t, i + 1)); + t = i + 1; + } + } + if(t < length()) + result.pushBack(slice(t, Base::m_count)); + + return result; + } + + define_member_function(template __ia__identifier, join, IN CONST Vector<_value_type>& values, IN CHAR delimiter) + { + __ia__identifier result; + // [IATODO] + return result; + } + #undef put_element #undef move_element #undef move_elements diff --git a/Src/IACore/inc/hpp/IACore/CLI.hpp b/Src/IACore/inc/hpp/IACore/CLI.hpp index 864cb60..0ed752e 100644 --- a/Src/IACore/inc/hpp/IACore/CLI.hpp +++ b/Src/IACore/inc/hpp/IACore/CLI.hpp @@ -203,7 +203,7 @@ namespace ia for (const auto &v : t->Value.Switches) { - printf(__CC_WHITE, "\t/%s %s\n", v.ID.c_str(), v.Help.c_str()); + printf(__CC_WHITE "//%s %s\n", v.ID.c_str(), v.Help.c_str()); } printf(__CC_DEFAULT "\n"); diff --git a/Src/IACore/inc/hpp/IACore/File.hpp b/Src/IACore/inc/hpp/IACore/File.hpp index 7f2fa5c..5b4cd56 100644 --- a/Src/IACore/inc/hpp/IACore/File.hpp +++ b/Src/IACore/inc/hpp/IACore/File.hpp @@ -20,6 +20,10 @@ #include #include +#ifdef __ANDROID__ +#include +#endif + namespace ia { class File diff --git a/Src/IACore/inc/hpp/IACore/Logger.hpp b/Src/IACore/inc/hpp/IACore/Logger.hpp index 086830d..8f0314a 100644 --- a/Src/IACore/inc/hpp/IACore/Logger.hpp +++ b/Src/IACore/inc/hpp/IACore/Logger.hpp @@ -32,7 +32,7 @@ namespace ia StringStream ss; UNUSED((ss << ... << args)); #ifdef __ANDROID__ - __android_log_print(ANDROID_LOG_DEBUG, "IAApp", ss.str().c_str()); + __android_log_print(ANDROID_LOG_DEBUG, "IAApp", "%s", ss.str().c_str()); #else printf("\033[0;37m[INFO]: [%s] %s\033[39m\n", tag, ss.str().c_str()); #endif @@ -43,7 +43,7 @@ namespace ia StringStream ss; UNUSED((ss << ... << args)); #ifdef __ANDROID__ - __android_log_print(ANDROID_LOG_INFO, "IAApp", ss.str().c_str()); + __android_log_print(ANDROID_LOG_INFO, "IAApp", "%s", ss.str().c_str()); #else printf("\033[32m[SUCCESS]: [%s] %s\033[39m\n", tag, ss.str().c_str()); #endif @@ -54,7 +54,7 @@ namespace ia StringStream ss; UNUSED((ss << ... << args)); #ifdef __ANDROID__ - __android_log_print(ANDROID_LOG_DEBUG, "IAApp", ss.str().c_str()); + __android_log_print(ANDROID_LOG_DEBUG, "IAApp", "%s", ss.str().c_str()); #else printf("\033[33m[WARN]: [%s] %s\033[39m\n", tag, ss.str().c_str()); #endif @@ -65,7 +65,7 @@ namespace ia StringStream ss; UNUSED((ss << ... << args)); #ifdef __ANDROID__ - __android_log_print(ANDROID_LOG_ERROR, "IAApp", ss.str().c_str()); + __android_log_print(ANDROID_LOG_ERROR, "IAApp", "%s", ss.str().c_str()); #else printf("\033[31m[ERROR]: [%s] %s\033[39m\n", tag, ss.str().c_str()); #endif