Fixes
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IACore/Container.hpp>
|
||||
#include <IACore/Vector.hpp>
|
||||
|
||||
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<StringT> split(IN CHAR delimiter);
|
||||
template<typename _value_type>
|
||||
INLINE STATIC StringT join(IN CONST Vector<_value_type>& values, IN CHAR delimiter);
|
||||
|
||||
public:
|
||||
VOID operator+=(IN char_type v)
|
||||
{
|
||||
|
||||
@ -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<typename _value_type> __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
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -20,6 +20,10 @@
|
||||
#include <IACore/String.hpp>
|
||||
#include <IACore/Vector.hpp>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <android/asset_manager.h>
|
||||
#endif
|
||||
|
||||
namespace ia
|
||||
{
|
||||
class File
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user