Compare commits
32 Commits
89d9217b29
...
_old
| Author | SHA1 | Date | |
|---|---|---|---|
| 38b6137c38 | |||
| 1118ec3205 | |||
| a7abdbae57 | |||
| c1cad88224 | |||
| cdc44137e8 | |||
| 2498e7d6e3 | |||
| 3add03dcc0 | |||
| f7d4b28744 | |||
| 9f9991494e | |||
| 6c3090f3c6 | |||
| 5a38f9f36d | |||
| 9bf876f823 | |||
| ee37b0a02b | |||
| 07638ea7b3 | |||
| 6ce5667ada | |||
| 5c02010ae1 | |||
| af084e0b94 | |||
| 1815ceb21d | |||
| 71f7ff8a85 | |||
| a73cc7e69c | |||
| 66299a7caf | |||
| b38dc220be | |||
| bb2a0501d5 | |||
| 0fd33d958e | |||
| 26debb5534 | |||
| 8e2e118dd5 | |||
| ada777c758 | |||
| e4940eae3b | |||
| b2f276a491 | |||
| c60810ba7b | |||
| fd54e8db39 | |||
| 503bd51043 |
Binary file not shown.
Binary file not shown.
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
@ -1,5 +1,6 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"*.rml": "html",
|
||||
"stdexcept": "cpp",
|
||||
"chrono": "cpp",
|
||||
"forward_list": "cpp",
|
||||
@ -67,6 +68,11 @@
|
||||
"iostream": "cpp",
|
||||
"map": "cpp",
|
||||
"ostream": "cpp",
|
||||
"xtree": "cpp"
|
||||
"xtree": "cpp",
|
||||
"condition_variable": "cpp",
|
||||
"coroutine": "cpp",
|
||||
"resumable": "cpp",
|
||||
"future": "cpp",
|
||||
"mutex": "cpp"
|
||||
}
|
||||
}
|
||||
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
@ -3,7 +3,7 @@
|
||||
{
|
||||
"label": "build",
|
||||
"type": "shell",
|
||||
"command": "cmake -S. -B./build -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ && cmake --build build",
|
||||
"command": "cmake -S. -B./build -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DIA_BUILD_SAMPLES=ON && cmake --build build",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
|
||||
@ -9,4 +9,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
project(IACore)
|
||||
add_subdirectory(Src/IACore)
|
||||
add_subdirectory(Src/IACoreTest)
|
||||
|
||||
if(IA_BUILD_SAMPLES)
|
||||
add_subdirectory(Src/IACoreTest)
|
||||
endif()
|
||||
@ -3,3 +3,7 @@ add_library(IACore STATIC imp/cpp/dummy.cpp)
|
||||
|
||||
target_include_directories(IACore PUBLIC inc/hpp imp/inl)
|
||||
target_compile_definitions(IACore PUBLIC _CRT_SECURE_NO_WARNINGS)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
target_link_libraries(IACore PUBLIC dl)
|
||||
endif()
|
||||
|
||||
@ -0,0 +1,139 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IACore/Vector.hpp>
|
||||
#include <IACore/Exception.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
class IStreamReader
|
||||
{
|
||||
public:
|
||||
STATIC RefPtr<IStreamReader> Create(IN PCCHAR filePath);
|
||||
STATIC RefPtr<IStreamReader> Create(IN Vector<UINT8> &&data);
|
||||
|
||||
public:
|
||||
PURE_VIRTUAL(BOOL CompareBytes(IN PCUINT8 data, IN INT64 length) CONST);
|
||||
|
||||
PURE_VIRTUAL(Vector<UINT8> Read());
|
||||
PURE_VIRTUAL(Vector<UINT8> Read(IN INT64 size));
|
||||
PURE_VIRTUAL(VOID Read(IN INT64 size, IN PUINT8 buffer));
|
||||
|
||||
PURE_VIRTUAL(UINT8 Read8());
|
||||
PURE_VIRTUAL(UINT16 Read16());
|
||||
PURE_VIRTUAL(UINT32 Read32());
|
||||
PURE_VIRTUAL(UINT64 Read64());
|
||||
|
||||
PURE_VIRTUAL(VOID Skip(IN INT64 size));
|
||||
PURE_VIRTUAL(INT64 Cursor() CONST);
|
||||
PURE_VIRTUAL(VOID Seek(IN INT64 newCursor));
|
||||
};
|
||||
|
||||
class MemoryStreamReader : public IStreamReader
|
||||
{
|
||||
public:
|
||||
STATIC INLINE RefPtr<IStreamReader> Create(IN Vector<UINT8> &&data);
|
||||
|
||||
public:
|
||||
INLINE BOOL CompareBytes(IN PCUINT8 data, IN INT64 length) CONST;
|
||||
|
||||
INLINE Vector<UINT8> Read();
|
||||
INLINE Vector<UINT8> Read(IN INT64 size);
|
||||
INLINE VOID Read(IN INT64 size, IN PUINT8 buffer);
|
||||
INLINE Vector<UINT8> ReadAndInflate(IN INT64 size);
|
||||
|
||||
INLINE UINT8 Read8();
|
||||
INLINE UINT16 Read16();
|
||||
INLINE UINT32 Read32();
|
||||
INLINE UINT64 Read64();
|
||||
|
||||
VOID Skip(IN INT64 size)
|
||||
{
|
||||
m_cursor += size;
|
||||
}
|
||||
|
||||
INT64 Cursor() CONST
|
||||
{
|
||||
return m_cursor;
|
||||
}
|
||||
|
||||
VOID Seek(IN INT64 newCursor)
|
||||
{
|
||||
m_cursor = newCursor;
|
||||
}
|
||||
|
||||
private:
|
||||
INT64 m_cursor{};
|
||||
Vector<UINT8> m_buffer;
|
||||
|
||||
private:
|
||||
INLINE MemoryStreamReader(IN Vector<UINT8> &&data);
|
||||
};
|
||||
|
||||
class FileStreamReader : public IStreamReader
|
||||
{
|
||||
public:
|
||||
STATIC INLINE RefPtr<IStreamReader> Create(IN PCCHAR filePath);
|
||||
|
||||
INLINE ~FileStreamReader();
|
||||
|
||||
public:
|
||||
INLINE BOOL CompareBytes(IN PCUINT8 data, IN INT64 length) CONST;
|
||||
|
||||
INLINE Vector<UINT8> Read();
|
||||
INLINE Vector<UINT8> Read(IN INT64 size);
|
||||
INLINE VOID Read(IN INT64 size, IN PUINT8 buffer);
|
||||
INLINE Vector<UINT8> ReadAndInflate(IN INT64 size);
|
||||
|
||||
INLINE UINT8 Read8();
|
||||
INLINE UINT16 Read16();
|
||||
INLINE UINT32 Read32();
|
||||
INLINE UINT64 Read64();
|
||||
|
||||
VOID Skip(IN INT64 size)
|
||||
{
|
||||
fseek(m_filePtr, ftell(m_filePtr) + size, SEEK_SET);
|
||||
}
|
||||
|
||||
INT64 Cursor() CONST
|
||||
{
|
||||
return ftell(m_filePtr);
|
||||
}
|
||||
|
||||
VOID Seek(IN INT64 newCursor)
|
||||
{
|
||||
fseek(m_filePtr, newCursor, SEEK_SET);
|
||||
}
|
||||
|
||||
private:
|
||||
FILE *m_filePtr{};
|
||||
|
||||
private:
|
||||
INLINE FileStreamReader(IN PCCHAR filePath);
|
||||
};
|
||||
|
||||
INLINE RefPtr<IStreamReader> IStreamReader::Create(IN PCCHAR filePath)
|
||||
{
|
||||
return FileStreamReader::Create(filePath);
|
||||
}
|
||||
|
||||
INLINE RefPtr<IStreamReader> IStreamReader::Create(IN Vector<UINT8> &&data)
|
||||
{
|
||||
return MemoryStreamReader::Create(std::move(data));
|
||||
}
|
||||
} // namespace ia
|
||||
196
Src/IACore/imp/inl/IACore/StreamReader/StreamReader.inl
Normal file
196
Src/IACore/imp/inl/IACore/StreamReader/StreamReader.inl
Normal file
@ -0,0 +1,196 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Interface/StreamReader.interface.inl"
|
||||
|
||||
namespace ia
|
||||
{
|
||||
RefPtr<IStreamReader> MemoryStreamReader::Create(IN Vector<UINT8> &&data)
|
||||
{
|
||||
struct make_shared_enabler : public MemoryStreamReader
|
||||
{
|
||||
make_shared_enabler(IN Vector<UINT8> &&data) : MemoryStreamReader(std::move(data))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
return std::make_shared<make_shared_enabler>(std::move(data));
|
||||
}
|
||||
|
||||
MemoryStreamReader::MemoryStreamReader(IN Vector<UINT8> &&data) : m_buffer(std::move(data))
|
||||
{
|
||||
m_cursor = 0;
|
||||
}
|
||||
|
||||
BOOL MemoryStreamReader::CompareBytes(IN PCUINT8 data, IN INT64 length) const
|
||||
{
|
||||
IA_RELEASE_ASSERT((m_cursor + length) <= m_buffer.size());
|
||||
return !memcmp(&m_buffer[m_cursor], data, length);
|
||||
}
|
||||
|
||||
Vector<UINT8> MemoryStreamReader::Read()
|
||||
{
|
||||
Vector<UINT8> res;
|
||||
res.resize(m_buffer.size() - m_cursor);
|
||||
Read(res.size(), res.data());
|
||||
return res;
|
||||
}
|
||||
|
||||
Vector<UINT8> MemoryStreamReader::Read(IN INT64 size)
|
||||
{
|
||||
Vector<UINT8> res;
|
||||
res.resize(size);
|
||||
Read(size, res.data());
|
||||
return res;
|
||||
}
|
||||
|
||||
VOID MemoryStreamReader::Read(IN INT64 size, IN PUINT8 buffer)
|
||||
{
|
||||
IA_RELEASE_ASSERT((m_cursor + size) <= m_buffer.size());
|
||||
memcpy(buffer, &m_buffer[m_cursor], size);
|
||||
m_cursor += size;
|
||||
}
|
||||
|
||||
UINT8 MemoryStreamReader::Read8()
|
||||
{
|
||||
IA_RELEASE_ASSERT((m_cursor + 1) <= m_buffer.size());
|
||||
return m_buffer[m_cursor++];
|
||||
}
|
||||
|
||||
UINT16 MemoryStreamReader::Read16()
|
||||
{
|
||||
IA_RELEASE_ASSERT((m_cursor + 2) <= m_buffer.size());
|
||||
const auto r = *reinterpret_cast<UINT16 *>(&m_buffer[m_cursor]);
|
||||
m_cursor += 2;
|
||||
return r;
|
||||
}
|
||||
|
||||
UINT32 MemoryStreamReader::Read32()
|
||||
{
|
||||
IA_RELEASE_ASSERT((m_cursor + 4) <= m_buffer.size());
|
||||
const auto r = *reinterpret_cast<UINT32 *>(&m_buffer[m_cursor]);
|
||||
m_cursor += 4;
|
||||
return r;
|
||||
}
|
||||
|
||||
UINT64 MemoryStreamReader::Read64()
|
||||
{
|
||||
IA_RELEASE_ASSERT((m_cursor + 8) <= m_buffer.size());
|
||||
const auto r = *reinterpret_cast<UINT64 *>(&m_buffer[m_cursor]);
|
||||
m_cursor += 8;
|
||||
return r;
|
||||
}
|
||||
} // namespace ia
|
||||
|
||||
namespace ia
|
||||
{
|
||||
RefPtr<IStreamReader> FileStreamReader::Create(IN PCCHAR filePath)
|
||||
{
|
||||
struct make_shared_enabler : public FileStreamReader
|
||||
{
|
||||
make_shared_enabler(IN PCCHAR filePath) : FileStreamReader(filePath)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
return std::make_shared<make_shared_enabler>(filePath);
|
||||
}
|
||||
|
||||
FileStreamReader::FileStreamReader(IN PCCHAR filePath)
|
||||
{
|
||||
m_filePtr = fopen(filePath, "rb");
|
||||
if (!m_filePtr)
|
||||
THROW_FILE_OPEN_READ(filePath);
|
||||
}
|
||||
|
||||
FileStreamReader ::~FileStreamReader()
|
||||
{
|
||||
if (m_filePtr)
|
||||
fclose(m_filePtr);
|
||||
}
|
||||
|
||||
BOOL FileStreamReader::CompareBytes(IN PCUINT8 data, IN INT64 length) CONST
|
||||
{
|
||||
IA_RELEASE_ASSERT(m_filePtr);
|
||||
STATIC Vector<UINT8> TmpBuffer;
|
||||
if (TmpBuffer.size() < length)
|
||||
TmpBuffer.resize(length);
|
||||
IA_RELEASE_ASSERT(fread(TmpBuffer.data(), 1, length, m_filePtr) == length);
|
||||
return !memcmp(TmpBuffer.data(), data, length);
|
||||
}
|
||||
|
||||
Vector<UINT8> FileStreamReader::Read()
|
||||
{
|
||||
IA_RELEASE_ASSERT(m_filePtr);
|
||||
Vector<UINT8> result;
|
||||
const auto s = ftell(m_filePtr);
|
||||
fseek(m_filePtr, 0, SEEK_END);
|
||||
const auto e = ftell(m_filePtr);
|
||||
fseek(m_filePtr, s, SEEK_SET);
|
||||
result.resize(e - s);
|
||||
IA_RELEASE_ASSERT(fread(result.data(), 1, result.size(), m_filePtr) == result.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
Vector<UINT8> FileStreamReader::Read(IN INT64 size)
|
||||
{
|
||||
IA_RELEASE_ASSERT(m_filePtr);
|
||||
Vector<UINT8> result;
|
||||
result.resize(size);
|
||||
IA_RELEASE_ASSERT(fread(result.data(), 1, size, m_filePtr) == size);
|
||||
return result;
|
||||
}
|
||||
|
||||
VOID FileStreamReader::Read(IN INT64 size, IN PUINT8 buffer)
|
||||
{
|
||||
IA_RELEASE_ASSERT(m_filePtr);
|
||||
IA_RELEASE_ASSERT(fread(buffer, 1, size, m_filePtr) == size);
|
||||
}
|
||||
|
||||
UINT8 FileStreamReader::Read8()
|
||||
{
|
||||
IA_RELEASE_ASSERT(m_filePtr);
|
||||
UINT8 result;
|
||||
IA_RELEASE_ASSERT(fread(&result, 1, 1, m_filePtr) == 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
UINT16 FileStreamReader::Read16()
|
||||
{
|
||||
IA_RELEASE_ASSERT(m_filePtr);
|
||||
UINT16 result;
|
||||
IA_RELEASE_ASSERT(fread(&result, 2, 1, m_filePtr) == 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
UINT32 FileStreamReader::Read32()
|
||||
{
|
||||
IA_RELEASE_ASSERT(m_filePtr);
|
||||
UINT32 result;
|
||||
IA_RELEASE_ASSERT(fread(&result, 4, 1, m_filePtr) == 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
UINT64 FileStreamReader::Read64()
|
||||
{
|
||||
IA_RELEASE_ASSERT(m_filePtr);
|
||||
UINT64 result;
|
||||
IA_RELEASE_ASSERT(fread(&result, 8, 1, m_filePtr) == 1);
|
||||
return result;
|
||||
}
|
||||
} // namespace ia
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/iterator.hpp>
|
||||
#include <IACore/Iterator.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/iterator.hpp>
|
||||
#include <IACore/Iterator.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/container.hpp>
|
||||
#include <IACore/container.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -16,8 +16,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/exception.hpp>
|
||||
#include <iacore/vector.hpp>
|
||||
#include <IACore/exception.hpp>
|
||||
#include <IACore/vector.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -300,6 +300,7 @@ namespace ia
|
||||
{
|
||||
const auto did_reallocate = reserve(newCount);
|
||||
for(; Base::m_count < newCount; Base::m_count++) Base::m_allocator.construct(&Base::m_data[Base::m_count]);
|
||||
Base::m_count = newCount;
|
||||
return did_reallocate;
|
||||
}
|
||||
|
||||
@ -16,8 +16,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/allocator.hpp>
|
||||
#include <iacore/memory.hpp>
|
||||
#include <IACore/Allocator.hpp>
|
||||
#include <IACore/Memory.hpp>
|
||||
|
||||
#include "span.interface.inl"
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/iterator.hpp>
|
||||
#include <IACore/Iterator.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -16,9 +16,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/allocator.hpp>
|
||||
#include <iacore/hashable.hpp>
|
||||
#include <iacore/memory.hpp>
|
||||
#include <IACore/Allocator.hpp>
|
||||
#include <IACore/Hashable.hpp>
|
||||
#include <IACore/Memory.hpp>
|
||||
|
||||
#include "iterator.interface.inl"
|
||||
|
||||
@ -16,41 +16,27 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/string.hpp"
|
||||
#include "interface/iihashable.interface.inl"
|
||||
|
||||
namespace ia
|
||||
{
|
||||
class Logger
|
||||
{
|
||||
public:
|
||||
template<typename... Args> STATIC VOID Info(Args... args)
|
||||
{
|
||||
StringStream ss;
|
||||
UNUSED((ss << ... << args));
|
||||
printf("\033[32m[INFO]: %s\033[39m\n", ss.str().c_str());
|
||||
}
|
||||
template<typename _type>
|
||||
concept hashable_type = std::derived_from<_type, IIHashable>;
|
||||
|
||||
template<typename... Args> STATIC VOID Warn(Args... args)
|
||||
{
|
||||
StringStream ss;
|
||||
UNUSED((ss << ... << args));
|
||||
printf("\033[33m[WARN]: %s\033[39m\n", ss.str().c_str());
|
||||
}
|
||||
|
||||
template<typename... Args> STATIC VOID Error(Args... args)
|
||||
{
|
||||
StringStream ss;
|
||||
UNUSED((ss << ... << args));
|
||||
printf("\033[31m[ERROR]: %s\033[39m\n", ss.str().c_str());
|
||||
}
|
||||
|
||||
private:
|
||||
Logger()
|
||||
{
|
||||
}
|
||||
|
||||
~Logger()
|
||||
{
|
||||
}
|
||||
template<typename T>
|
||||
concept comparible_type = requires(T a, T b) {
|
||||
{ a == b } -> std::same_as<bool>;
|
||||
};
|
||||
|
||||
INLINE UINT64 IIHashable::fnv_1a(IN PCUINT8 data, IN SIZE_T dataLength)
|
||||
{
|
||||
// Implemented as described at http://isthe.com/chongo/tech/comp/fnv/#google_vignette
|
||||
UINT64 hash = 14695981039346656037llu;
|
||||
for (SIZE_T i = 0; i < dataLength; i++)
|
||||
{
|
||||
hash = hash ^ data[i];
|
||||
hash = hash * 1099511628211ul;
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
} // namespace ia
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/base.hpp>
|
||||
#include <IACore/Base.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/base.hpp>
|
||||
#include <IACore/Base.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/types.hpp>
|
||||
#include <IACore/types.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/types.hpp>
|
||||
#include <IACore/types.hpp>
|
||||
|
||||
/*
|
||||
* -----------------------------------
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/types.hpp>
|
||||
#include <IACore/types.hpp>
|
||||
|
||||
/*
|
||||
* -----------------------------------
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/allocator.hpp>
|
||||
#include <IACore/Allocator.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/allocator.hpp>
|
||||
#include <IACore/Allocator.hpp>
|
||||
|
||||
//#include "iterator.interface.inl"
|
||||
#include "entry.interface.inl"
|
||||
@ -16,14 +16,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/list.hpp>
|
||||
#include <iacore/vector.hpp>
|
||||
#include <iacore/hashable.hpp>
|
||||
#include <IACore/List.hpp>
|
||||
#include <IACore/Vector.hpp>
|
||||
#include <IACore/Hashable.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
template<typename _key_type, typename _value_type, typename _allocator_type = GeneralAllocator<_value_type>, CONST SIZE_T _alignment = 1>
|
||||
requires hashable_type<_key_type> && valid_allocator_type<_allocator_type, _value_type>
|
||||
requires (hashable_type<_key_type> || std::is_integral_v<_key_type>) && valid_allocator_type<_allocator_type, _value_type>
|
||||
class Map
|
||||
{
|
||||
STATIC CONSTEXPR SIZE_T BUCKET_COUNT = 1000;
|
||||
96
Src/IACore/imp/inl/IACore/map/map.inl
Normal file
96
Src/IACore/imp/inl/IACore/map/map.inl
Normal file
@ -0,0 +1,96 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "interface/map.interface.inl"
|
||||
|
||||
#define __template \
|
||||
template<typename _key_type, typename _value_type, typename _allocator_type, CONST SIZE_T _alignment> \
|
||||
requires(hashable_type<_key_type> || std::is_integral_v<_key_type>) && \
|
||||
valid_allocator_type<_allocator_type, _value_type>
|
||||
#define __ia_identifier Map<_key_type, _value_type, _allocator_type, _alignment>
|
||||
#define define_member_function(return_type, name, ...) __template return_type __ia_identifier::name(__VA_ARGS__)
|
||||
#define define_const_member_function(return_type, name, ...) \
|
||||
__template return_type __ia_identifier::name(__VA_ARGS__) CONST
|
||||
|
||||
namespace ia
|
||||
{
|
||||
define_member_function(, Map, )
|
||||
{
|
||||
m_buckets.resize(BUCKET_COUNT);
|
||||
}
|
||||
|
||||
define_member_function(, ~Map, )
|
||||
{
|
||||
}
|
||||
} // namespace ia
|
||||
|
||||
namespace ia
|
||||
{
|
||||
define_member_function(VOID, set, IN CONST key_type &key, IN value_type &&value)
|
||||
{
|
||||
const auto listEntry = getBucket(key).append({key, IA_MOVE(value)});
|
||||
m_insertedOrder.pushBack(*listEntry);
|
||||
}
|
||||
|
||||
define_const_member_function(CONST _value_type *, get, IN CONST key_type &key)
|
||||
{
|
||||
auto &bucket = getBucket(key);
|
||||
for (auto it = bucket.first(); it; it = bucket.next(it))
|
||||
{
|
||||
if (static_cast<KeyValuePair>(*it).Key == key)
|
||||
return &(*it)->Value;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
define_const_member_function(BOOL, contains, IN CONST key_type &key)
|
||||
{
|
||||
auto &bucket = getBucket(key);
|
||||
for (auto it = bucket.first(); it; it = bucket.next(it))
|
||||
{
|
||||
if (static_cast<KeyValuePair>(*it).Key == key)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} // namespace ia
|
||||
|
||||
namespace ia
|
||||
{
|
||||
define_member_function(List<typename __ia_identifier::KeyValuePair> &, getBucket, IN CONST key_type &key)
|
||||
{
|
||||
if constexpr (std::is_integral_v<key_type>)
|
||||
return m_buckets[key % BUCKET_COUNT];
|
||||
else
|
||||
return m_buckets[key.hash() % BUCKET_COUNT];
|
||||
}
|
||||
|
||||
define_const_member_function(CONST List<typename __ia_identifier::KeyValuePair> &, getBucket,
|
||||
IN CONST key_type &key)
|
||||
{
|
||||
if constexpr (std::is_integral_v<key_type>)
|
||||
return m_buckets[key % BUCKET_COUNT];
|
||||
else
|
||||
return m_buckets[key.hash() % BUCKET_COUNT];
|
||||
}
|
||||
} // namespace ia
|
||||
|
||||
#undef __template
|
||||
#undef __ia_identifier
|
||||
#undef define_member_function
|
||||
#undef define_const_member_function
|
||||
@ -47,7 +47,7 @@ namespace ia
|
||||
UNUSED(hint);
|
||||
const size_type size = (sizeof(value_type) * count);
|
||||
const auto ptr = reinterpret_cast<size_type>(_ia_malloc(size + alignment + sizeof(PVOID)));
|
||||
const auto aligned_ptr = reinterpret_cast<size_type>(ptr + sizeof(PVOID) + alignment - (ptr % alignment));
|
||||
const auto aligned_ptr = (size_type)(ptr + sizeof(PVOID) + alignment - (ptr % alignment));
|
||||
*(reinterpret_cast<size_type*>(aligned_ptr-sizeof(PVOID))) = ptr;
|
||||
return reinterpret_cast<pointer_type>(aligned_ptr);
|
||||
}
|
||||
@ -17,7 +17,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory.h>
|
||||
#include <iacore/base.hpp>
|
||||
#include <IACore/Base.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/base.hpp>
|
||||
#include <IACore/Base.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -0,0 +1,36 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IACore/Base.hpp>
|
||||
#include <memory>
|
||||
|
||||
#define REF_PTR_CLASS \
|
||||
template<typename _value_type, typename... Args> friend INLINE RefPtr<_value_type> MakeRefPtr(Args &&...args) \
|
||||
{ \
|
||||
return std::make_shared<_value_type>(std::forward<Args>(args)...); \
|
||||
}
|
||||
|
||||
namespace ia
|
||||
{
|
||||
template<typename _value_type> using RefPtr = std::shared_ptr<_value_type>;
|
||||
|
||||
template<typename _value_type, typename... Args> INLINE RefPtr<_value_type> MakeRefPtr(Args &&...args)
|
||||
{
|
||||
return std::make_shared<_value_type>(std::forward<Args>(args)...);
|
||||
}
|
||||
} // namespace ia
|
||||
0
Src/IACore/imp/inl/IACore/platform/android/.gitkeep
Normal file
0
Src/IACore/imp/inl/IACore/platform/android/.gitkeep
Normal file
25
Src/IACore/imp/inl/IACore/platform/environment.inl
Normal file
25
Src/IACore/imp/inl/IACore/platform/environment.inl
Normal file
@ -0,0 +1,25 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "platform.inl"
|
||||
|
||||
#if (defined(IA_CORE_PLATFORM_FEATUES) && (IA_CORE_PLATFORM_FEATUES > 0))
|
||||
#if (defined(IA_PLATFORM_WIN64) && (IA_PLATFORM_WIN64 > 0))
|
||||
#include "win/environment.inl"
|
||||
#endif
|
||||
#endif
|
||||
@ -0,0 +1,29 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IACore/String.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
class Environment
|
||||
{
|
||||
public:
|
||||
INLINE STATIC String GetVar(IN CONST String& name);
|
||||
INLINE STATIC BOOL SetVar(IN CONST String& name, IN CONST String& value);
|
||||
};
|
||||
}
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/base.hpp>
|
||||
#include <IACore/Base.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -1,29 +1,34 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/base.hpp>
|
||||
#include <memory>
|
||||
#include <IACore/String.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
template<typename _value_type>
|
||||
using RefPtr = std::shared_ptr<_value_type>;
|
||||
class SubProcess
|
||||
{
|
||||
public:
|
||||
INLINE SubProcess(IN CONST String &path);
|
||||
INLINE ~SubProcess();
|
||||
|
||||
template<typename _value_type, typename... Args>
|
||||
INLINE RefPtr<_value_type> MakeRefPtr(Args... args) { return std::make_shared<_value_type>(args...); }
|
||||
}
|
||||
INLINE INT32 Launch(IN CONST String &args, IN Function<VOID(CONST String &)> onOutputLineCallback);
|
||||
|
||||
private:
|
||||
CONST String m_path;
|
||||
};
|
||||
} // namespace ia
|
||||
0
Src/IACore/imp/inl/IACore/platform/ios/.gitkeep
Normal file
0
Src/IACore/imp/inl/IACore/platform/ios/.gitkeep
Normal file
0
Src/IACore/imp/inl/IACore/platform/linux/.gitkeep
Normal file
0
Src/IACore/imp/inl/IACore/platform/linux/.gitkeep
Normal file
0
Src/IACore/imp/inl/IACore/platform/macos/.gitkeep
Normal file
0
Src/IACore/imp/inl/IACore/platform/macos/.gitkeep
Normal file
@ -132,4 +132,11 @@ namespace ia
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if (defined(IA_PLATFORM_WIN64) && (IA_PLATFORM_WIN64 > 0))
|
||||
#define IA_CORE_PLATFORM_FEATUES 1
|
||||
#else
|
||||
#define IA_CORE_PLATFORM_FEATUES 0
|
||||
#warning "IACore Unsupported Platform: Platform specific features will be disabled"
|
||||
#endif
|
||||
25
Src/IACore/imp/inl/IACore/platform/process.inl
Normal file
25
Src/IACore/imp/inl/IACore/platform/process.inl
Normal file
@ -0,0 +1,25 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "platform.inl"
|
||||
|
||||
#if (defined(IA_CORE_PLATFORM_FEATUES) && (IA_CORE_PLATFORM_FEATUES > 0))
|
||||
#if (defined(IA_PLATFORM_WIN64) && (IA_PLATFORM_WIN64 > 0))
|
||||
#include "win/process.inl"
|
||||
#endif
|
||||
#endif
|
||||
@ -1,24 +1,25 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/base.hpp>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
// [IATODO: IMP]
|
||||
|
||||
}
|
||||
@ -1,37 +1,40 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "interface/iihashable.interface.inl"
|
||||
#include "../interface/environment.interface.inl"
|
||||
#include "common.inl"
|
||||
|
||||
namespace ia
|
||||
{
|
||||
template<typename _type>
|
||||
concept hashable_type = std::derived_from<_type, IIHashable>;
|
||||
|
||||
INLINE UINT64 IIHashable::fnv_1a(IN PCUINT8 data, IN SIZE_T dataLength)
|
||||
{
|
||||
// Implemented as described at http://isthe.com/chongo/tech/comp/fnv/#google_vignette
|
||||
UINT64 hash = 14695981039346656037llu;
|
||||
for(SIZE_T i = 0; i < dataLength; i++)
|
||||
String Environment::GetVar(IN CONST String &name)
|
||||
{
|
||||
hash = hash ^ data[i];
|
||||
hash = hash * 1099511628211ul;
|
||||
const auto l = GetEnvironmentVariableA(name.c_str(), nullptr, 0);
|
||||
if (!l)
|
||||
return "";
|
||||
String result;
|
||||
result.resize(l);
|
||||
GetEnvironmentVariableA(name.c_str(), result.data(), l);
|
||||
result.back() = '\0';
|
||||
return result;
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL Environment::SetVar(IN CONST String &name, IN CONST String &value)
|
||||
{
|
||||
return SetEnvironmentVariableA(name.c_str(), value.c_str());
|
||||
}
|
||||
} // namespace ia
|
||||
137
Src/IACore/imp/inl/IACore/platform/win/process.inl
Normal file
137
Src/IACore/imp/inl/IACore/platform/win/process.inl
Normal file
@ -0,0 +1,137 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../interface/process.interface.inl"
|
||||
#include "common.inl"
|
||||
|
||||
#include <IACore/Exception.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
SubProcess::SubProcess(IN CONST String &path) : m_path(path)
|
||||
{
|
||||
}
|
||||
|
||||
SubProcess::~SubProcess()
|
||||
{
|
||||
}
|
||||
|
||||
INT32 SubProcess::Launch(IN CONST String &args, IN Function<VOID(CONST String &)> onOutputLineCallback)
|
||||
{
|
||||
String szCmdline = BuildString(m_path, " ", args);
|
||||
|
||||
PROCESS_INFORMATION piProcInfo;
|
||||
STARTUPINFOA siStartInfo;
|
||||
BOOL bSuccess = FALSE;
|
||||
ZeroMemory(&piProcInfo, sizeof(PROCESS_INFORMATION));
|
||||
|
||||
HANDLE hRdStdIn{};
|
||||
HANDLE hWrStdIn{};
|
||||
HANDLE hRdStdOut{};
|
||||
HANDLE hWrStdOut{};
|
||||
|
||||
SECURITY_ATTRIBUTES saAttr;
|
||||
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
saAttr.bInheritHandle = TRUE;
|
||||
saAttr.lpSecurityDescriptor = NULL;
|
||||
if (!CreatePipe(&hRdStdIn, &hWrStdIn, &saAttr, 0))
|
||||
THROW_UNKNOWN("Failed to create a win32 pipe");
|
||||
if (!SetHandleInformation(hWrStdIn, HANDLE_FLAG_INHERIT, 0))
|
||||
THROW_UNKNOWN("Failed to update a win32 pipe");
|
||||
if (!CreatePipe(&hRdStdOut, &hWrStdOut, &saAttr, 0))
|
||||
THROW_UNKNOWN("Failed to create a win32 pipe");
|
||||
if (!SetHandleInformation(hRdStdOut, HANDLE_FLAG_INHERIT, 0))
|
||||
THROW_UNKNOWN("Failed to update a win32 pipe");
|
||||
|
||||
ZeroMemory(&siStartInfo, sizeof(STARTUPINFOA));
|
||||
siStartInfo.cb = sizeof(STARTUPINFOA);
|
||||
siStartInfo.hStdError = hWrStdOut;
|
||||
siStartInfo.hStdOutput = hWrStdOut;
|
||||
siStartInfo.hStdInput = hRdStdIn;
|
||||
siStartInfo.dwFlags |= STARTF_USESTDHANDLES;
|
||||
|
||||
bSuccess = CreateProcessA(NULL,
|
||||
szCmdline.data(), // command line
|
||||
NULL, // process security attributes
|
||||
NULL, // primary thread security attributes
|
||||
TRUE, // handles are inherited
|
||||
0, // creation flags
|
||||
NULL, // use parent's environment
|
||||
NULL, // use parent's current directory
|
||||
&siStartInfo, // STARTUPINFO pointer
|
||||
&piProcInfo); // receives PROCESS_INFORMATION
|
||||
|
||||
if (!bSuccess)
|
||||
THROW_UNKNOWN("Couldn't spawn the child process \"", m_path, "\"");
|
||||
else
|
||||
{
|
||||
CloseHandle(piProcInfo.hProcess);
|
||||
CloseHandle(piProcInfo.hThread);
|
||||
|
||||
CloseHandle(hWrStdOut);
|
||||
CloseHandle(hRdStdIn);
|
||||
}
|
||||
|
||||
CloseHandle(hWrStdIn);
|
||||
|
||||
DWORD exitCode{};
|
||||
while (true)
|
||||
{
|
||||
GetExitCodeProcess(piProcInfo.hProcess, &exitCode);
|
||||
if (exitCode != STILL_ACTIVE)
|
||||
break;
|
||||
}
|
||||
|
||||
Vector<CHAR> currentLine;
|
||||
CHAR readBuffer[1024];
|
||||
while (true)
|
||||
{
|
||||
DWORD readSize;
|
||||
const auto success = ReadFile(hRdStdOut, readBuffer, sizeof(readBuffer), &readSize, NULL);
|
||||
if ((!success) || (!readSize))
|
||||
break;
|
||||
for (DWORD i = 0; i < readSize; i++)
|
||||
{
|
||||
if (readBuffer[i] == '\n')
|
||||
{
|
||||
String result;
|
||||
result.resize(currentLine.size() + 1);
|
||||
memcpy(result.data(), currentLine.data(), currentLine.size());
|
||||
result[currentLine.size()] = '\0';
|
||||
currentLine.reset();
|
||||
onOutputLineCallback(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
currentLine.append(readBuffer[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (currentLine.size())
|
||||
{
|
||||
String result;
|
||||
result.resize(currentLine.size() + 1);
|
||||
memcpy(result.data(), currentLine.data(), currentLine.size());
|
||||
result[currentLine.size()] = '\0';
|
||||
onOutputLineCallback(result);
|
||||
}
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
} // namespace ia
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/vector.hpp>
|
||||
#include <IACore/vector.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -38,6 +38,11 @@ namespace ia
|
||||
|
||||
StringStream& operator<<(IN CONST String& v) { m_impl << v.c_str(); return *this; }
|
||||
|
||||
VOID clear()
|
||||
{
|
||||
m_impl.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
std::stringstream m_impl;
|
||||
};
|
||||
@ -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
|
||||
@ -276,7 +302,11 @@ namespace ia
|
||||
const auto count = last - first;
|
||||
res.reserve((count/stride) + 2);
|
||||
const auto end = start + count + 1;
|
||||
for(size_type i = start; i < end; i += stride) new (&res.m_data[res.m_count++]) value_type(Base::m_data[i]);
|
||||
for(size_type i = start; i < end; i += stride)
|
||||
{
|
||||
new (&res.m_data[res.m_count++]) value_type(Base::m_data[i]);
|
||||
if(!Base::m_data[i]) break;
|
||||
}
|
||||
res.back() = '\0';
|
||||
return IA_MOVE(res);
|
||||
}
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/container.hpp>
|
||||
#include <IACore/Container.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/algorithm.hpp>
|
||||
#include <IACore/Algorithm.hpp>
|
||||
|
||||
#include "interface/ordered.interface.inl"
|
||||
|
||||
@ -1,85 +0,0 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "interface/map.interface.inl"
|
||||
|
||||
#define __template template<typename _key_type, typename _value_type, typename _allocator_type, CONST SIZE_T _alignment> requires hashable_type<_key_type> && valid_allocator_type<_allocator_type, _value_type>
|
||||
#define __ia_identifier Map<_key_type, _value_type, _allocator_type, _alignment>
|
||||
#define define_member_function(return_type, name, ...) __template return_type __ia_identifier::name(__VA_ARGS__)
|
||||
#define define_const_member_function(return_type, name, ...) __template return_type __ia_identifier::name(__VA_ARGS__) CONST
|
||||
|
||||
namespace ia
|
||||
{
|
||||
define_member_function(, Map, )
|
||||
{
|
||||
m_buckets.resize(BUCKET_COUNT);
|
||||
}
|
||||
|
||||
define_member_function(, ~Map, )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
namespace ia
|
||||
{
|
||||
define_member_function(VOID, set, IN CONST key_type& key, IN value_type&& value)
|
||||
{
|
||||
const auto listEntry = getBucket(key).append({ key, IA_MOVE(value) });
|
||||
m_insertedOrder.pushBack(*listEntry);
|
||||
}
|
||||
|
||||
define_const_member_function(CONST _value_type*, get, IN CONST key_type& key)
|
||||
{
|
||||
auto& bucket = getBucket(key);
|
||||
for(auto it = bucket.first(); it; it = bucket.next(it))
|
||||
{
|
||||
if(static_cast<KeyValuePair>(*it).Key == key)
|
||||
return &(*it)->Value;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
define_const_member_function(BOOL, contains, IN CONST key_type& key)
|
||||
{
|
||||
auto& bucket = getBucket(key);
|
||||
for(auto it = bucket.first(); it; it = bucket.next(it))
|
||||
{
|
||||
if(static_cast<KeyValuePair>(*it).Key == key)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
namespace ia
|
||||
{
|
||||
define_member_function(List<typename __ia_identifier::KeyValuePair>&, getBucket, IN CONST key_type& key)
|
||||
{
|
||||
return m_buckets[key.hash() % BUCKET_COUNT];
|
||||
}
|
||||
|
||||
define_const_member_function(CONST List<typename __ia_identifier::KeyValuePair>&, getBucket, IN CONST key_type& key)
|
||||
{
|
||||
return m_buckets[key.hash() % BUCKET_COUNT];
|
||||
}
|
||||
}
|
||||
|
||||
#undef __template
|
||||
#undef __ia_identifier
|
||||
#undef define_member_function
|
||||
#undef define_const_member_function
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/algorithm/binary-search.inl"
|
||||
#include "iacore/algorithm/quick-sort.inl"
|
||||
#include "IACore/algorithm/binary-search.inl"
|
||||
#include "IACore/algorithm/quick-sort.inl"
|
||||
|
||||
namespace ia {}
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/memory/allocator/general.inl"
|
||||
#include "iacore/memory/allocator/orchestrator.inl"
|
||||
#include "IACore/memory/allocator/general.inl"
|
||||
#include "IACore/memory/allocator/orchestrator.inl"
|
||||
|
||||
namespace ia {}
|
||||
@ -16,6 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/array/array.inl"
|
||||
#include "IACore/array/array.inl"
|
||||
|
||||
namespace ia {}
|
||||
@ -17,13 +17,13 @@
|
||||
#pragma once
|
||||
|
||||
#if __STDC_HOSTED__ and !IACORE_FREESTANDING
|
||||
#include <iacore/types.hpp>
|
||||
#include <IACore/Types.hpp>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <cstring>
|
||||
#define _lib_impl_ std
|
||||
#else
|
||||
#include "iacore/lib.hpp"
|
||||
#include "IACore/lib.hpp"
|
||||
#define _lib_impl_ ia
|
||||
#endif
|
||||
|
||||
@ -16,6 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/bytestring/bytestring.inl"
|
||||
#include "IACore/bytestring/bytestring.inl"
|
||||
|
||||
namespace ia {}
|
||||
218
Src/IACore/inc/hpp/IACore/CLI.hpp
Normal file
218
Src/IACore/inc/hpp/IACore/CLI.hpp
Normal file
@ -0,0 +1,218 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IACore/Map.hpp>
|
||||
#include <IACore/String.hpp>
|
||||
#include <IACore/Vector.hpp>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
class CLI
|
||||
{
|
||||
public:
|
||||
enum class ParameterValueType
|
||||
{
|
||||
INT,
|
||||
STRING,
|
||||
INT_LIST,
|
||||
STRING_LIST
|
||||
};
|
||||
|
||||
struct ParameterValue
|
||||
{
|
||||
ParameterValueType Type{};
|
||||
INT32 IntValue{};
|
||||
String StringValue{};
|
||||
Vector<INT32> IntListValue{};
|
||||
Vector<String> StringListValue{};
|
||||
};
|
||||
|
||||
struct ParameterDesc
|
||||
{
|
||||
String ID;
|
||||
String Help;
|
||||
BOOL IsOptional{};
|
||||
ParameterValueType Type{};
|
||||
};
|
||||
|
||||
struct SwitchDesc
|
||||
{
|
||||
String ID;
|
||||
String Help;
|
||||
};
|
||||
|
||||
struct CommandDesc
|
||||
{
|
||||
String ID;
|
||||
CHAR Shorthand{};
|
||||
String Help;
|
||||
Vector<SwitchDesc> Switches;
|
||||
Vector<ParameterDesc> Parameters;
|
||||
std::function<INT32(IN Map<String, ParameterValue> &¶meters, IN Map<String, BOOL> &&switchValues)>
|
||||
Action;
|
||||
};
|
||||
|
||||
public:
|
||||
CLI(IN CONST String &appName, IN IA_VERSION_TYPE appVersion, IN CONST String ©rightNotice)
|
||||
: m_appName(appName), m_appVersion(IA_STRINGIFY_VERSION(appVersion)), m_copyrightNotice(copyrightNotice)
|
||||
{
|
||||
RegisterCommand({
|
||||
.ID = "help",
|
||||
.Shorthand = 'h',
|
||||
.Help = "Displays this help menu",
|
||||
.Action =
|
||||
[&](IN Map<String, ParameterValue> &¶meters, IN Map<String, BOOL> &&switchValues) {
|
||||
DisplayHelp();
|
||||
return 0;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
INLINE INT32 Run(IN INT32 argc, IN PCCHAR argv[]);
|
||||
|
||||
protected:
|
||||
INLINE VOID RegisterCommand(IN CONST CommandDesc &desc);
|
||||
|
||||
private:
|
||||
INLINE VOID DisplayHelp();
|
||||
|
||||
private:
|
||||
CONST String m_appName;
|
||||
CONST String m_appVersion;
|
||||
CONST String m_copyrightNotice;
|
||||
Map<String, CommandDesc> m_commands;
|
||||
};
|
||||
} // namespace ia
|
||||
|
||||
namespace ia
|
||||
{
|
||||
INT32 CLI::Run(IN INT32 argc, IN PCCHAR argv[])
|
||||
{
|
||||
printf(__CC_WHITE "%s %s\n%s\n\n" __CC_DEFAULT, m_appName.c_str(), m_appVersion.c_str(),
|
||||
m_copyrightNotice.c_str());
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
DisplayHelp();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!m_commands.contains(argv[1]))
|
||||
{
|
||||
printf(__CC_RED "No such known command \"%s\".\n" __CC_YELLOW
|
||||
"TIP: Use \"help\" to see available commands!" __CC_DEFAULT "\n",
|
||||
argv[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
const auto cmd = m_commands[argv[1]];
|
||||
const auto requiredParamCount = (INT32) cmd.Parameters.size();
|
||||
if ((requiredParamCount << 1) >= (argc - 1))
|
||||
{
|
||||
printf(__CC_RED "Command \"%s\" requires at least %i parameter(s).\n" __CC_YELLOW
|
||||
"TIP: Use \"help\" to see correct usages!" __CC_DEFAULT "\n",
|
||||
argv[1], requiredParamCount);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Map<String, ParameterDesc> params;
|
||||
for (const auto &t : cmd.Parameters)
|
||||
params[t.ID] = t;
|
||||
|
||||
Map<String, ParameterValue> paramValues;
|
||||
|
||||
for (INT32 i = 2; i < argc; i++)
|
||||
{
|
||||
if (argv[i][0] == '-')
|
||||
{
|
||||
const auto paramName = &(argv[i][1]);
|
||||
if (!params.contains(paramName))
|
||||
{
|
||||
printf(__CC_RED "No such parameter \"%s\".\n" __CC_YELLOW
|
||||
"TIP: Use \"help\" to see correct usages!" __CC_DEFAULT "\n",
|
||||
argv[i]);
|
||||
return -3;
|
||||
}
|
||||
|
||||
const auto& p = params[paramName];
|
||||
|
||||
// Read parameter value
|
||||
const auto value = argv[++i];
|
||||
switch(p.Type)
|
||||
{
|
||||
case ParameterValueType::INT:
|
||||
paramValues[paramName] = ParameterValue{.Type = p.Type};
|
||||
break;
|
||||
|
||||
case ParameterValueType::STRING:
|
||||
paramValues[paramName] = ParameterValue{.Type = p.Type, .StringValue = value};
|
||||
break;
|
||||
|
||||
case ParameterValueType::INT_LIST:
|
||||
paramValues[paramName] = ParameterValue{.Type = p.Type};
|
||||
break;
|
||||
|
||||
case ParameterValueType::STRING_LIST:
|
||||
paramValues[paramName] = ParameterValue{.Type = p.Type};
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (argv[i][0] == '/')
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(__CC_RED "Invalid command syntax, expected a parameter('-') or a switch('/')." __CC_DEFAULT
|
||||
"\n");
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
cmd.Action(IA_MOVE(paramValues), {});
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
VOID CLI::DisplayHelp()
|
||||
{
|
||||
INT32 i{1};
|
||||
for (const auto &t : m_commands)
|
||||
{
|
||||
printf(__CC_WHITE "%i) " __CC_GREEN "%s (%c) " __CC_YELLOW "- %s\n", i, t->Value.ID.c_str(),
|
||||
t->Value.Shorthand, t->Value.Help.c_str());
|
||||
|
||||
for (const auto &v : t->Value.Parameters)
|
||||
{
|
||||
printf(__CC_WHITE "\t-%s %s %s\n", v.ID.c_str(), v.IsOptional ? "(optional)" : "", v.Help.c_str());
|
||||
}
|
||||
|
||||
for (const auto &v : t->Value.Switches)
|
||||
{
|
||||
printf(__CC_WHITE "//%s %s\n", v.ID.c_str(), v.Help.c_str());
|
||||
}
|
||||
|
||||
printf(__CC_DEFAULT "\n");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
VOID CLI::RegisterCommand(IN CONST CommandDesc &desc)
|
||||
{
|
||||
m_commands[desc.ID] = desc;
|
||||
}
|
||||
} // namespace ia
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/definitions.hpp"
|
||||
#include <IACore/Definitions.hpp>
|
||||
|
||||
#if __IA_DEBUG || IAC_SEC_LEVEL(1)
|
||||
#define __IAC_OVERFLOW_CHECKS 1
|
||||
23
Src/IACore/inc/hpp/IACore/Container.hpp
Normal file
23
Src/IACore/inc/hpp/IACore/Container.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IACore/container/span.inl"
|
||||
#include "IACore/container/fixed.inl"
|
||||
#include "IACore/container/dynamic.inl"
|
||||
|
||||
namespace ia {}
|
||||
188
Src/IACore/inc/hpp/IACore/Definitions.hpp
Normal file
188
Src/IACore/inc/hpp/IACore/Definitions.hpp
Normal file
@ -0,0 +1,188 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <concepts>
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
#include <initializer_list>
|
||||
#include <new>
|
||||
#include <sstream>
|
||||
#include <type_traits>
|
||||
|
||||
#define IAC_SEC_LEVEL(v) (IACORE_SECURITY_LEVEL >= v)
|
||||
|
||||
#define IA_DEFINED_TRUE(o) (defined(o) && (o > 0))
|
||||
|
||||
#if defined(__IA_DEBUG) && __IA_DEBUG
|
||||
#define __DEBUG_MODE__
|
||||
#define __BUILD_MODE_NAME "debug"
|
||||
#define DEBUG_ONLY(v) v
|
||||
#else
|
||||
#define __RELEASE_MODE__
|
||||
#define __BUILD_MODE_NAME "release"
|
||||
#ifndef NDEBUG
|
||||
#define NDEBUG
|
||||
#endif
|
||||
#ifndef __OPTIMIZE__
|
||||
#define __OPTIMIZE__
|
||||
#endif
|
||||
#define DEBUG_ONLY(f)
|
||||
#endif
|
||||
|
||||
#define AUTO auto
|
||||
#define CONST const
|
||||
#define STATIC static
|
||||
#define EXTERN extern
|
||||
#define VIRTUAL virtual
|
||||
#define OVERRIDE override
|
||||
#define CONSTEXPR constexpr
|
||||
#define NOEXCEPT noexcept
|
||||
#define NORETURN [[noreturn]]
|
||||
|
||||
#define IA_MOVE(...) std::move(__VA_ARGS__)
|
||||
|
||||
#define DEFINE_TYPE(t, v) typedef v t
|
||||
#define FORWARD_DECLARE(t, i) t i
|
||||
|
||||
#define PURE_VIRTUAL(f) VIRTUAL f = 0
|
||||
|
||||
#define INLINE inline
|
||||
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
|
||||
#define ALWAYS_INLINE __attribute__((always_inline)) inline
|
||||
#elif defined(_MSC_VER)
|
||||
#define ALWAYS_INLINE __forceinline
|
||||
#endif
|
||||
|
||||
#define UNUSED(v) ((void) v);
|
||||
|
||||
#define NO_DISCARD(s) [[nodiscard(s)]]
|
||||
|
||||
#define B_LIKELY(cond) (cond) [[likely]]
|
||||
#define B_UNLIKELY(cond) (cond) [[unlikely]]
|
||||
|
||||
#define __INTERNAL_IA_STRINGIFY(value) #value
|
||||
#define IA_STRINGIFY(value) __INTERNAL_IA_STRINGIFY(value)
|
||||
|
||||
#define DECONST(t, v) const_cast<t>(v)
|
||||
|
||||
#define ALIGN(a) __attribute__((aligned(a)))
|
||||
|
||||
// Mark every explicit assembly instruction as volatile
|
||||
#define ASM(...) __asm__ volatile(__VA_ARGS__)
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#ifndef NULLPTR
|
||||
#define NULLPTR nullptr
|
||||
#endif
|
||||
|
||||
#undef TRUE
|
||||
#undef FALSE
|
||||
#define FALSE false
|
||||
#define TRUE true
|
||||
|
||||
#define IN
|
||||
#define OUT
|
||||
#define INOUT
|
||||
|
||||
#undef VOID
|
||||
#undef C_DECL
|
||||
|
||||
#define C_DECL(f) EXTERN "C" f
|
||||
|
||||
#define CAST(v, t) ((t) v)
|
||||
|
||||
#define ALIAS_FUNCTION(alias, function) \
|
||||
template<typename... Args> auto alias(Args &&...args) -> decltype(f(std::forward<Args>(args)...)) \
|
||||
{ \
|
||||
return function(std::forward<Args>(args)...); \
|
||||
}
|
||||
|
||||
#define ALIAS_TEMPLATE_FUNCTION(t, alias, function) \
|
||||
template<typename t, typename... Args> \
|
||||
auto alias(Args &&...args) -> decltype(function<t>(std::forward<Args>(args)...)) \
|
||||
{ \
|
||||
return function<t>(std::forward<Args>(args)...); \
|
||||
}
|
||||
|
||||
#define IA_RELEASE_ASSERT(v) assert((v))
|
||||
#define IA_RELEASE_ASSERT_MSG(v, m) assert((v) && m)
|
||||
|
||||
#if defined(__DEBUG_MODE__)
|
||||
#define IA_ASSERT(v) IA_RELEASE_ASSERT(v)
|
||||
#define IA_ASSERT_MSG(v, m) IA_RELEASE_ASSERT_MSG(v, m)
|
||||
#else
|
||||
#define IA_ASSERT(v)
|
||||
#define IA_ASSERT_MSG(v, m)
|
||||
#endif
|
||||
|
||||
#define IA_ASSERT_EQ(a, b) IA_ASSERT((a) == (b))
|
||||
#define IA_ASSERT_GE(a, b) IA_ASSERT((a) >= (b))
|
||||
#define IA_ASSERT_LE(a, b) IA_ASSERT(a <= b)
|
||||
#define IA_ASSERT_LT(a, b) IA_ASSERT(a < b)
|
||||
#define IA_ASSERT_GT(a, b) IA_ASSERT(a > b)
|
||||
#define IA_ASSERT_IMPLIES(a, b) IA_ASSERT(!(a) || (b))
|
||||
#define IA_ASSERT_NOT_NULL(v) IA_ASSERT(((v) != nullptr))
|
||||
|
||||
#define IA_UNREACHABLE(msg) IA_RELEASE_ASSERT_MSG(false, "an unreachable portion of code was executed: " msg)
|
||||
|
||||
#define IA_MAX_PATH_LENGTH PATH_MAX
|
||||
#define IA_MAX_POSSIBLE_SIZE (static_cast<SIZE_T>(0x7FFFFFFFFFFFF))
|
||||
#define IA_MAX_STRING_LENGTH (IA_MAX_POSSIBLE_SIZE >> 8)
|
||||
|
||||
#define IA_VERSION_TYPE UINT64
|
||||
#define IA_MAKE_VERSION(major, minor, patch) \
|
||||
((static_cast<UINT64>(major) & 0xFFFFFF) << 40) | ((static_cast<UINT64>(minor) & 0xFFFFFF) << 16) | \
|
||||
(static_cast<UINT64>(patch) & 0xFFFF)
|
||||
#define IA_STRINGIFY_VERSION(version) \
|
||||
BuildString("v", (version >> 40) & 0xFFFFFF, ".", (version >> 16) & 0xFFFFFF, ".", version & 0xFFFF)
|
||||
#define IA_PARSE_VERSION_STRING(versionString) \
|
||||
[](IN std::string str) { \
|
||||
INT32 minor, major, patch; \
|
||||
char dot; \
|
||||
std::stringstream ss(str); \
|
||||
ss >> major >> dot >> minor >> dot >> patch; \
|
||||
return IA_MAKE_VERSION(major, minor, patch); \
|
||||
}(versionString)
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define IA_DLL_EXPORT __declspec(dllexport)
|
||||
#define IA_DLL_IMPORT __declspec(dllimport)
|
||||
#elif defined(__GNUC__)
|
||||
#define IA_DLL_EXPORT __attribute__((visibility("default")))
|
||||
#define IA_DLL_IMPORT
|
||||
#else
|
||||
#define IA_DLL_EXPORT
|
||||
#define IA_DLL_IMPORT
|
||||
#endif
|
||||
|
||||
#define __CC_BLACK "\033[30m"
|
||||
#define __CC_RED "\033[31m"
|
||||
#define __CC_GREEN "\033[32m"
|
||||
#define __CC_YELLOW "\033[33m"
|
||||
#define __CC_BLUE "\033[34m"
|
||||
#define __CC_MAGENTA "\033[35m"
|
||||
#define __CC_CYAN "\033[36m"
|
||||
#define __CC_WHITE "\033[37m"
|
||||
#define __CC_DEFAULT "\033[39m"
|
||||
114
Src/IACore/inc/hpp/IACore/DynamicLib.hpp
Normal file
114
Src/IACore/inc/hpp/IACore/DynamicLib.hpp
Normal file
@ -0,0 +1,114 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IACore/Exception.hpp>
|
||||
#include <IACore/String.hpp>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
namespace ia
|
||||
{
|
||||
class DynamicLib
|
||||
{
|
||||
public:
|
||||
STATIC INLINE DynamicLib Load(IN CONST String &searchPath, IN CONST String &name);
|
||||
|
||||
INLINE ~DynamicLib();
|
||||
|
||||
INLINE VOID Destroy();
|
||||
|
||||
public:
|
||||
INLINE PVOID GetSymbol(IN CONST String &name);
|
||||
|
||||
template<typename FunctionType> FunctionType GetFunction(IN CONST String &name)
|
||||
{
|
||||
return reinterpret_cast<FunctionType>(GetSymbol(name));
|
||||
}
|
||||
|
||||
private:
|
||||
INLINE DynamicLib(IN PVOID moduleHandle);
|
||||
|
||||
private:
|
||||
CONST PVOID m_moduleHandle;
|
||||
};
|
||||
} // namespace ia
|
||||
|
||||
namespace ia
|
||||
{
|
||||
DynamicLib::DynamicLib(IN PVOID moduleHandle) : m_moduleHandle(moduleHandle)
|
||||
{
|
||||
}
|
||||
|
||||
DynamicLib::~DynamicLib()
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
DynamicLib DynamicLib::Load(IN CONST String &searchPath, IN CONST String &name)
|
||||
{
|
||||
const auto handle = LoadLibraryA(BuildString(searchPath, "/", name, ".dll").c_str());
|
||||
if (handle == NULL)
|
||||
THROW_UNKNOWN("DynamicLib: Failed to load the library \"", name, "\" with error: ", GetLastError());
|
||||
return DynamicLib((PVOID) handle);
|
||||
}
|
||||
|
||||
PVOID DynamicLib::GetSymbol(IN CONST String &name)
|
||||
{
|
||||
const auto symbol = GetProcAddress(static_cast<HMODULE>(m_moduleHandle), name.c_str());
|
||||
if (symbol == NULL)
|
||||
THROW_UNKNOWN("DynamicLib: Failed to find the symbol \"", name, "\" with error: ", GetLastError());
|
||||
return (PVOID) symbol;
|
||||
}
|
||||
|
||||
VOID DynamicLib::Destroy()
|
||||
{
|
||||
if (m_moduleHandle)
|
||||
FreeLibrary(static_cast<HMODULE>(m_moduleHandle));
|
||||
}
|
||||
#else
|
||||
DynamicLib DynamicLib::Load(IN CONST String &searchPath, IN CONST String &name)
|
||||
{
|
||||
dlerror();
|
||||
const auto handle = dlopen(BuildString(searchPath, "/", name, ".so").c_str(), RTLD_LAZY);
|
||||
if (handle == NULL)
|
||||
THROW_UNKNOWN("DynamicLib: Failed to load the library \"", name, "\" with error: ", dlerror());
|
||||
return DynamicLib((PVOID) handle);
|
||||
}
|
||||
|
||||
PVOID DynamicLib::GetSymbol(IN CONST String &name)
|
||||
{
|
||||
dlerror();
|
||||
const auto symbol = dlsym(m_moduleHandle, name.c_str());
|
||||
const char *dlsym_error = dlerror();
|
||||
if (dlsym_error)
|
||||
THROW_UNKNOWN("DynamicLib: Failed to find the symbol \"", name, "\" with error: ", dlerror());
|
||||
return (PVOID) symbol;
|
||||
}
|
||||
|
||||
VOID DynamicLib::Destroy()
|
||||
{
|
||||
if (m_moduleHandle)
|
||||
dlclose(m_moduleHandle);
|
||||
}
|
||||
#endif
|
||||
} // namespace ia
|
||||
@ -1,24 +1,23 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "interface/xop.interface.inl"
|
||||
#include <IACore/platform/environment.inl>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
// [IATODO: IMP]
|
||||
}
|
||||
} // namespace ia
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iacore/string.hpp>
|
||||
#include <IACore/Logger.hpp>
|
||||
|
||||
namespace ia {
|
||||
enum class ExceptionKind {
|
||||
@ -131,7 +131,9 @@ private:
|
||||
DO(SECURITY_BYPASS)
|
||||
#define DEFINE_THROWER(name) \
|
||||
template <typename... Args> NORETURN VOID THROW_##name(Args... args) { \
|
||||
throw RuntimeException(ExceptionKind::name, BuildString(args...)); \
|
||||
const auto msg = BuildString(args...); \
|
||||
Logger::Error("EXCEPT", "(", #name, "): ", msg); \
|
||||
throw RuntimeException(ExceptionKind::name, msg); \
|
||||
}
|
||||
FOR_EACH_RUNTIME_EXCEPT_TYPE(DEFINE_THROWER);
|
||||
#undef DEFINE_THROWER
|
||||
@ -16,12 +16,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/types.hpp"
|
||||
#include <cstdio>
|
||||
#include <filesystem>
|
||||
#include <iacore/exception.hpp>
|
||||
#include <iacore/string.hpp>
|
||||
#include <iacore/vector.hpp>
|
||||
#include <IACore/Exception.hpp>
|
||||
#include <IACore/String.hpp>
|
||||
#include <IACore/Vector.hpp>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <android/asset_manager.h>
|
||||
#endif
|
||||
|
||||
namespace ia
|
||||
{
|
||||
@ -35,12 +36,12 @@ namespace ia
|
||||
OPEN_FLAG_BINARY = 4,
|
||||
};
|
||||
|
||||
public:
|
||||
public:
|
||||
STATIC Vector<UINT8> ReadToVector(IN CONST String &path)
|
||||
{
|
||||
File f(path, OPEN_FLAG_READ | OPEN_FLAG_BINARY);
|
||||
return f.ReadToVector();
|
||||
}
|
||||
}
|
||||
|
||||
STATIC String ReadToString(IN CONST String &path)
|
||||
{
|
||||
@ -109,25 +110,36 @@ namespace ia
|
||||
}
|
||||
|
||||
public:
|
||||
template<BOOL includeExtension> STATIC INLINE String ExtractFilenameFromPath(IN CONST String &path)
|
||||
template<BOOL includeExtension> STATIC String ExtractFilenameFromPath(IN CONST String &path)
|
||||
{
|
||||
#if IA_DEFINED_TRUE(IA_PLATFORM_WINDOWS)
|
||||
constexpr char pathDelimiter = '\\';
|
||||
#else
|
||||
constexpr char pathDelimiter = '/';
|
||||
#endif
|
||||
auto t = path.rfind(pathDelimiter, 0);
|
||||
|
||||
auto t = path.rfind(pathDelimiter);
|
||||
if (t == path.end())
|
||||
{
|
||||
if constexpr (includeExtension)
|
||||
return path.slice(path.begin(), path.cend());
|
||||
if CONSTEXPR (includeExtension)
|
||||
return path;
|
||||
|
||||
return path.slice(path.begin(), path.rfind('.', 0));
|
||||
return path.slice(0, path.rfind('.'));
|
||||
}
|
||||
if constexpr (includeExtension)
|
||||
return path.slice(t + 1, path.cend());
|
||||
return path.slice(t + 1, path.end());
|
||||
|
||||
return path.slice(t + 1, path.rfind('.', 0));
|
||||
return path.slice(t + 1, path.rfind('.'));
|
||||
}
|
||||
|
||||
template<BOOL includeTrailingSlash> STATIC String ExtractDirectoryFromPath(IN CONST String &path)
|
||||
{
|
||||
constexpr char pathDelimiter = '/';
|
||||
|
||||
auto t = path.rfind(pathDelimiter);
|
||||
if (t == path.end())
|
||||
return "./";
|
||||
|
||||
if CONSTEXPR (includeTrailingSlash)
|
||||
return path.slice(path.begin(), t + 1);
|
||||
else
|
||||
return path.slice(path.begin(), t);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -16,6 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/hashable/iihashable.inl"
|
||||
#include "IACore/hashable/iihashable.inl"
|
||||
|
||||
namespace ia {}
|
||||
@ -23,7 +23,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <iacore/types.hpp>
|
||||
#include <IACore/Types.hpp>
|
||||
|
||||
#define valid_iatest_runner(type) iatest::_valid_iatest_runner<type>::value_type
|
||||
#define template_iatest_runner template<typename _runner_type> requires valid_iatest_runner(_runner_type)
|
||||
@ -16,6 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/iterator/iterator.inl"
|
||||
#include "IACore/iterator/iterator.inl"
|
||||
|
||||
namespace ia {}
|
||||
23
Src/IACore/inc/hpp/IACore/Lib.hpp
Normal file
23
Src/IACore/inc/hpp/IACore/Lib.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IACore/lib/math.inl"
|
||||
#include "IACore/lib/mem.inl"
|
||||
#include "IACore/lib/str.inl"
|
||||
|
||||
namespace ia {}
|
||||
@ -16,6 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/xop/xop.inl"
|
||||
#include "IACore/list/list.inl"
|
||||
|
||||
namespace ia {}
|
||||
83
Src/IACore/inc/hpp/IACore/Logger.hpp
Normal file
83
Src/IACore/inc/hpp/IACore/Logger.hpp
Normal file
@ -0,0 +1,83 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IACore/String.hpp>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
||||
namespace ia
|
||||
{
|
||||
class Logger
|
||||
{
|
||||
public:
|
||||
template<typename... Args> STATIC VOID Info(PCCHAR tag, Args... args)
|
||||
{
|
||||
StringStream ss;
|
||||
UNUSED((ss << ... << args));
|
||||
#ifdef __ANDROID__
|
||||
__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
|
||||
}
|
||||
|
||||
template<typename... Args> STATIC VOID Success(PCCHAR tag, Args... args)
|
||||
{
|
||||
StringStream ss;
|
||||
UNUSED((ss << ... << args));
|
||||
#ifdef __ANDROID__
|
||||
__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
|
||||
}
|
||||
|
||||
template<typename... Args> STATIC VOID Warn(PCCHAR tag, Args... args)
|
||||
{
|
||||
StringStream ss;
|
||||
UNUSED((ss << ... << args));
|
||||
#ifdef __ANDROID__
|
||||
__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
|
||||
}
|
||||
|
||||
template<typename... Args> STATIC VOID Error(PCCHAR tag, Args... args)
|
||||
{
|
||||
StringStream ss;
|
||||
UNUSED((ss << ... << args));
|
||||
#ifdef __ANDROID__
|
||||
__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
|
||||
}
|
||||
|
||||
private:
|
||||
Logger()
|
||||
{
|
||||
}
|
||||
|
||||
~Logger()
|
||||
{
|
||||
}
|
||||
};
|
||||
} // namespace ia
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/map/map.inl"
|
||||
#include "IACore/map/map.inl"
|
||||
|
||||
namespace ia
|
||||
{
|
||||
21
Src/IACore/inc/hpp/IACore/Memory.hpp
Normal file
21
Src/IACore/inc/hpp/IACore/Memory.hpp
Normal file
@ -0,0 +1,21 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IACore/memory/ptr/interface/refptr.interface.inl"
|
||||
|
||||
namespace ia {}
|
||||
@ -16,6 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/platform/platform.inl"
|
||||
#include "IACore/platform/platform.inl"
|
||||
|
||||
namespace ia {}
|
||||
23
Src/IACore/inc/hpp/IACore/Process.hpp
Normal file
23
Src/IACore/inc/hpp/IACore/Process.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
// IACore-OSS; The Core Library for All IA Open Source Projects
|
||||
// Copyright (C) 2024 IAS (ias@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IACore/platform/process.inl>
|
||||
|
||||
namespace ia
|
||||
{
|
||||
} // namespace ia
|
||||
@ -16,6 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/set/set.inl"
|
||||
#include "IACore/set/set.inl"
|
||||
|
||||
namespace ia {}
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iacore/container/span.inl"
|
||||
#include "IACore/container/span.inl"
|
||||
|
||||
namespace ia
|
||||
{
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user