From 9bf876f823020c7422c878a5b2960d67af5e78be Mon Sep 17 00:00:00 2001 From: Isuru Samarathunga Date: Wed, 22 Oct 2025 09:33:54 +0530 Subject: [PATCH 1/2] Fixes --- .../inl/IACore/StreamReader/StreamReader.inl | 4 +-- .../string/interface/string.interface.inl | 6 ++++- Src/IACore/imp/inl/IACore/string/string.inl | 26 +++++++++++++++++++ Src/IACore/inc/hpp/IACore/CLI.hpp | 2 +- Src/IACore/inc/hpp/IACore/File.hpp | 4 +++ Src/IACore/inc/hpp/IACore/Logger.hpp | 8 +++--- 6 files changed, 42 insertions(+), 8 deletions(-) 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 From 6c3090f3c6cff06c4f79f28cbc85f43242be4283 Mon Sep 17 00:00:00 2001 From: Isuru Samarathunga Date: Fri, 24 Oct 2025 21:11:23 +0530 Subject: [PATCH 2/2] Add Process, Thread and Environment --- .vscode/settings.json | 8 +- .../imp/inl/IACore/platform/android/.gitkeep | 0 .../imp/inl/IACore/platform/environment.inl | 25 ++++ .../interface/environment.interface.inl | 29 ++++ .../platform/interface/platform.interface.inl | 2 +- .../platform/interface/process.interface.inl | 34 +++++ .../imp/inl/IACore/platform/ios/.gitkeep | 0 .../imp/inl/IACore/platform/linux/.gitkeep | 0 .../imp/inl/IACore/platform/macos/.gitkeep | 0 .../imp/inl/IACore/platform/process.inl | 25 ++++ .../imp/inl/IACore/platform/win/common.inl | 25 ++++ .../inl/IACore/platform/win/environment.inl | 40 +++++ .../imp/inl/IACore/platform/win/process.inl | 137 ++++++++++++++++++ Src/IACore/inc/hpp/IACore/Environment.hpp | 23 +++ Src/IACore/inc/hpp/IACore/Process.hpp | 23 +++ Src/IACore/inc/hpp/IACore/Thread.hpp | 28 ++++ Src/IACore/inc/hpp/IACore/Types.hpp | 3 + Src/IACoreTest/imp/cpp/Main.cpp | 30 ++-- 18 files changed, 416 insertions(+), 16 deletions(-) create mode 100644 Src/IACore/imp/inl/IACore/platform/android/.gitkeep create mode 100644 Src/IACore/imp/inl/IACore/platform/environment.inl create mode 100644 Src/IACore/imp/inl/IACore/platform/interface/environment.interface.inl create mode 100644 Src/IACore/imp/inl/IACore/platform/interface/process.interface.inl create mode 100644 Src/IACore/imp/inl/IACore/platform/ios/.gitkeep create mode 100644 Src/IACore/imp/inl/IACore/platform/linux/.gitkeep create mode 100644 Src/IACore/imp/inl/IACore/platform/macos/.gitkeep create mode 100644 Src/IACore/imp/inl/IACore/platform/process.inl create mode 100644 Src/IACore/imp/inl/IACore/platform/win/common.inl create mode 100644 Src/IACore/imp/inl/IACore/platform/win/environment.inl create mode 100644 Src/IACore/imp/inl/IACore/platform/win/process.inl create mode 100644 Src/IACore/inc/hpp/IACore/Environment.hpp create mode 100644 Src/IACore/inc/hpp/IACore/Process.hpp create mode 100644 Src/IACore/inc/hpp/IACore/Thread.hpp diff --git a/.vscode/settings.json b/.vscode/settings.json index 5383c6a..6783045 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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" } } \ No newline at end of file diff --git a/Src/IACore/imp/inl/IACore/platform/android/.gitkeep b/Src/IACore/imp/inl/IACore/platform/android/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Src/IACore/imp/inl/IACore/platform/environment.inl b/Src/IACore/imp/inl/IACore/platform/environment.inl new file mode 100644 index 0000000..7ff6450 --- /dev/null +++ b/Src/IACore/imp/inl/IACore/platform/environment.inl @@ -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 . + +#pragma once + +#include "platform.inl" + +#if (defined(IA_PLATFORM_WIN64) && (IA_PLATFORM_WIN64 > 0)) + #include "win/environment.inl" +#else + #error "IACore Unsupported Platform" +#endif \ No newline at end of file diff --git a/Src/IACore/imp/inl/IACore/platform/interface/environment.interface.inl b/Src/IACore/imp/inl/IACore/platform/interface/environment.interface.inl new file mode 100644 index 0000000..9002742 --- /dev/null +++ b/Src/IACore/imp/inl/IACore/platform/interface/environment.interface.inl @@ -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 . + +#pragma once + +#include + +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); + }; +} \ No newline at end of file diff --git a/Src/IACore/imp/inl/IACore/platform/interface/platform.interface.inl b/Src/IACore/imp/inl/IACore/platform/interface/platform.interface.inl index f335d11..1d8cea2 100644 --- a/Src/IACore/imp/inl/IACore/platform/interface/platform.interface.inl +++ b/Src/IACore/imp/inl/IACore/platform/interface/platform.interface.inl @@ -16,7 +16,7 @@ #pragma once -#include +#include namespace ia { diff --git a/Src/IACore/imp/inl/IACore/platform/interface/process.interface.inl b/Src/IACore/imp/inl/IACore/platform/interface/process.interface.inl new file mode 100644 index 0000000..82f551f --- /dev/null +++ b/Src/IACore/imp/inl/IACore/platform/interface/process.interface.inl @@ -0,0 +1,34 @@ +// 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 . + +#pragma once + +#include + +namespace ia +{ + class SubProcess + { + public: + INLINE SubProcess(IN CONST String &path); + INLINE ~SubProcess(); + + INLINE INT32 Launch(IN CONST String &args, IN Function onOutputLineCallback); + + private: + CONST String m_path; + }; +} // namespace ia \ No newline at end of file diff --git a/Src/IACore/imp/inl/IACore/platform/ios/.gitkeep b/Src/IACore/imp/inl/IACore/platform/ios/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Src/IACore/imp/inl/IACore/platform/linux/.gitkeep b/Src/IACore/imp/inl/IACore/platform/linux/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Src/IACore/imp/inl/IACore/platform/macos/.gitkeep b/Src/IACore/imp/inl/IACore/platform/macos/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Src/IACore/imp/inl/IACore/platform/process.inl b/Src/IACore/imp/inl/IACore/platform/process.inl new file mode 100644 index 0000000..886500e --- /dev/null +++ b/Src/IACore/imp/inl/IACore/platform/process.inl @@ -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 . + +#pragma once + +#include "platform.inl" + +#if (defined(IA_PLATFORM_WIN64) && (IA_PLATFORM_WIN64 > 0)) + #include "win/process.inl" +#else + #error "IACore Unsupported Platform" +#endif \ No newline at end of file diff --git a/Src/IACore/imp/inl/IACore/platform/win/common.inl b/Src/IACore/imp/inl/IACore/platform/win/common.inl new file mode 100644 index 0000000..0070b60 --- /dev/null +++ b/Src/IACore/imp/inl/IACore/platform/win/common.inl @@ -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 . + +#pragma once + +#define WIN32_LEAN_AND_MEAN +#include + +namespace ia +{ + +} \ No newline at end of file diff --git a/Src/IACore/imp/inl/IACore/platform/win/environment.inl b/Src/IACore/imp/inl/IACore/platform/win/environment.inl new file mode 100644 index 0000000..65e61cc --- /dev/null +++ b/Src/IACore/imp/inl/IACore/platform/win/environment.inl @@ -0,0 +1,40 @@ +// 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 . + +#pragma once + +#include "../interface/environment.interface.inl" +#include "common.inl" + +namespace ia +{ + String Environment::GetVar(IN CONST String &name) + { + 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; + } + + BOOL Environment::SetVar(IN CONST String &name, IN CONST String &value) + { + return SetEnvironmentVariableA(name.c_str(), value.c_str()); + } +} // namespace ia \ No newline at end of file diff --git a/Src/IACore/imp/inl/IACore/platform/win/process.inl b/Src/IACore/imp/inl/IACore/platform/win/process.inl new file mode 100644 index 0000000..1896ead --- /dev/null +++ b/Src/IACore/imp/inl/IACore/platform/win/process.inl @@ -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 . + +#pragma once + +#include "../interface/process.interface.inl" +#include "common.inl" + +#include + +namespace ia +{ + SubProcess::SubProcess(IN CONST String &path) : m_path(path) + { + } + + SubProcess::~SubProcess() + { + } + + INT32 SubProcess::Launch(IN CONST String &args, IN Function 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 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 \ No newline at end of file diff --git a/Src/IACore/inc/hpp/IACore/Environment.hpp b/Src/IACore/inc/hpp/IACore/Environment.hpp new file mode 100644 index 0000000..2d17bf8 --- /dev/null +++ b/Src/IACore/inc/hpp/IACore/Environment.hpp @@ -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 . + +#pragma once + +#include + +namespace ia +{ +} // namespace ia \ No newline at end of file diff --git a/Src/IACore/inc/hpp/IACore/Process.hpp b/Src/IACore/inc/hpp/IACore/Process.hpp new file mode 100644 index 0000000..05ee556 --- /dev/null +++ b/Src/IACore/inc/hpp/IACore/Process.hpp @@ -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 . + +#pragma once + +#include + +namespace ia +{ +} // namespace ia \ No newline at end of file diff --git a/Src/IACore/inc/hpp/IACore/Thread.hpp b/Src/IACore/inc/hpp/IACore/Thread.hpp new file mode 100644 index 0000000..7e1f6cd --- /dev/null +++ b/Src/IACore/inc/hpp/IACore/Thread.hpp @@ -0,0 +1,28 @@ +// 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 . + +#pragma once + +#include + +#include +#include + +namespace ia +{ + using Mutex = std::mutex; + using ScopeMutex = std::lock_guard; +} \ No newline at end of file diff --git a/Src/IACore/inc/hpp/IACore/Types.hpp b/Src/IACore/inc/hpp/IACore/Types.hpp index d6012df..9a9e050 100644 --- a/Src/IACore/inc/hpp/IACore/Types.hpp +++ b/Src/IACore/inc/hpp/IACore/Types.hpp @@ -98,6 +98,9 @@ namespace ia typedef CONST FLOAT32 PCFLOAT32; typedef CONST FLOAT64 PCFLOAT64; + template + using Function = std::function; + /* Uses the UEFI standard GUID structure definition */ typedef struct _IA_GUID { diff --git a/Src/IACoreTest/imp/cpp/Main.cpp b/Src/IACoreTest/imp/cpp/Main.cpp index db6b1bf..d0517e2 100644 --- a/Src/IACoreTest/imp/cpp/Main.cpp +++ b/Src/IACoreTest/imp/cpp/Main.cpp @@ -1,34 +1,36 @@ -#include #include +#include -#include #include +#include + +#include +#include using namespace ia; -template -VOID print(IN CONST Span<_value_type>& s) +template VOID print(IN CONST Span<_value_type> &s) { - for(const auto& v: s) + for (const auto &v : s) Logger::Info("IACore", v); } -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { - Vector v1{10, 20, 32}; - + /*ector v1{10, 20, 32}; print(v1); - List l1; - Map m1; m1["sdd"] = 2; m1["bx"] = 5; - - for(const auto& v: m1) - { + for (const auto &v : m1) printf("%s, %i\n", v->Key.c_str(), v->Value); - } + SubProcess p("clang++"); + p.Launch("a.cpp", [](IN CONST String &line) { printf("[\n%s\n]\n", line.c_str()); });*/ + + printf("[%s]\n", Environment::GetVar("IAEDK_ROOT").c_str()); + Environment::SetVar("IAEDK_ROOT", "C:\\IAEDK"); + printf("[%s]\n", Environment::GetVar("IAEDK_ROOT").c_str()); return 0; } \ No newline at end of file