diff --git a/.cache/clangd/index/Main.cpp.8DF821074DA7C9F4.idx b/.cache/clangd/index/Main.cpp.8DF821074DA7C9F4.idx index af47278..0eed745 100644 Binary files a/.cache/clangd/index/Main.cpp.8DF821074DA7C9F4.idx and b/.cache/clangd/index/Main.cpp.8DF821074DA7C9F4.idx differ diff --git a/Src/IACore/imp/inl/iacore/container/fixed.inl b/Src/IACore/imp/inl/iacore/container/fixed.inl index f73e66a..9a86400 100644 --- a/Src/IACore/imp/inl/iacore/container/fixed.inl +++ b/Src/IACore/imp/inl/iacore/container/fixed.inl @@ -31,15 +31,15 @@ namespace ia define_member_function(, FixedContainer, IN size_type count) { - m_count = count; - m_data = alloc<_alignment>(m_allocator, m_count); - m_allocator.construct(m_data, m_count); + Base::m_count = count; + Base::m_data = alloc<_alignment>(m_allocator, Base::m_count); + m_allocator.construct(Base::m_data, Base::m_count); } define_member_function(, FixedContainer, IN initializer_list v) { - m_data = alloc<_alignment>(m_allocator, v.size()); - for(const auto& value: v) new (&m_data[m_count++]) value_type(value); + Base::m_data = alloc<_alignment>(m_allocator, v.size()); + for(const auto& value: v) new (&Base::m_data[Base::m_count++]) value_type(value); } define_member_function(, ~FixedContainer,) @@ -49,19 +49,19 @@ namespace ia define_member_function(VOID, reset,) { - if(m_data) + if(Base::m_data) { - m_allocator.destruct(m_data, m_count); - dealloc<_alignment>(m_allocator, m_data); - m_data = nullptr; + m_allocator.destruct(Base::m_data, Base::m_count); + dealloc<_alignment>(m_allocator, Base::m_data); + Base::m_data = nullptr; } - m_count = 0; + Base::m_count = 0; } define_member_function(__ia__identifier::pointer_type, take,) { - auto res = m_data; - m_data = nullptr; + auto res = Base::m_data; + Base::m_data = nullptr; reset(); return res; } @@ -69,15 +69,15 @@ namespace ia define_member_function(VOID, copy_from, IN CONST __ia__identifier& r) { m_allocator = r.m_allocator.selectOnContainerCopy(); - m_data = alloc<_alignment>(m_allocator, (m_count = r.m_count)); - for(size_type i = 0; i < m_count; i++) - new (&m_data[i]) value_type(r.m_data[i]); + Base::m_data = alloc<_alignment>(m_allocator, (Base::m_count = r.Base::m_count)); + for(size_type i = 0; i < Base::m_count; i++) + new (&Base::m_data[i]) value_type(r.Base::m_data[i]); } define_member_function(VOID, take_from, IN __ia__identifier&& r) { - ia_swap(m_data, r.m_data); - ia_swap(m_count, r.m_count); + ia_swap(Base::m_data, r.Base::m_data); + ia_swap(Base::m_count, r.Base::m_count); ia_swap(m_allocator, r.m_allocator); } } @@ -106,121 +106,58 @@ namespace ia define_const_member_function(__ia__identifier::const_iterator, cfind, IN comparator_type c, IN size_type offset) { - for(size_type i = offset; i < m_count; i++) - if(!c(m_data[i])) return { &m_data[i] }; + for(size_type i = offset; i < Base::m_count; i++) + if(!c(Base::m_data[i])) return { &Base::m_data[i] }; return end(); } define_const_member_function(__ia__identifier::const_iterator, crfind, IN comparator_type c, IN size_type offset) { - for(ssize_type i = m_count - 1; i >= offset; i--) - if(!c(m_data[i])) return { &m_data[i] }; + for(ssize_type i = Base::m_count - 1; i >= offset; i--) + if(!c(Base::m_data[i])) return { &Base::m_data[i] }; return end(); } define_const_member_function(template __ia__identifier::const_iterator, cfind, IN CONST compare_type& v, IN size_type offset) { - for(size_type i = offset; i < m_count; i++) - if(v == m_data[i]) return { &m_data[i] }; + for(size_type i = offset; i < Base::m_count; i++) + if(v == Base::m_data[i]) return { &Base::m_data[i] }; return end(); } define_const_member_function(template __ia__identifier::const_iterator, crfind, IN CONST compare_type& v, IN size_type offset) { - for(ssize_type i = m_count - 1; i >= offset; i--) - if(v == m_data[i]) return { &m_data[i] }; + for(ssize_type i = Base::m_count - 1; i >= offset; i--) + if(v == Base::m_data[i]) return { &Base::m_data[i] }; return end(); } define_const_member_function(BOOL, contains, IN comparator_type v) { - for(size_type i = 0; i < m_count; i++) - if(!c(m_data[i])) return true; + for(size_type i = 0; i < Base::m_count; i++) + if(!c(Base::m_data[i])) return true; return false; } define_const_member_function(template BOOL, contains, IN CONST compare_type& v) { - for(size_type i = 0; i < m_count; i++) - if(v == m_data[i]) return true; + for(size_type i = 0; i < Base::m_count; i++) + if(v == Base::m_data[i]) return true; return false; } define_const_member_function(BOOL, operator==, IN CONST FixedContainer& o) { - if(m_count != o.size()) return false; + if(Base::m_count != o.size()) return false; const auto data = o.data(); for(size_type i = 0; i < o.size(); i++) - if(m_data[i] != data[i]) return false; + if(Base::m_data[i] != data[i]) return false; return true; } define_const_member_function(UINT64, hash,) { - return IIHashable::fnv_1a((PCUINT8)m_data, m_count * sizeof(value_type)); - } -} - -namespace ia -{ - define_member_function(__ia__identifier::iterator, begin,) - { - return cbegin(); - } - - define_member_function(__ia__identifier::iterator, end,) - { - return cend(); - } - - define_member_function(__ia__identifier::reverse_iterator, rbegin,) - { - return crbegin(); - } - - define_member_function(__ia__identifier::reverse_iterator, rend,) - { - return crend(); - } - - define_const_member_function(__ia__identifier::const_iterator, begin,) - { - return cbegin(); - } - - define_const_member_function(__ia__identifier::const_iterator, end,) - { - return cend(); - } - - define_const_member_function(__ia__identifier::const_iterator, cbegin,) - { - return { m_data }; - } - - define_const_member_function(__ia__identifier::const_iterator, cend,) - { - return { m_data + m_count }; - } - - define_const_member_function(__ia__identifier::reverse_const_iterator, rbegin,) - { - return crbegin(); - } - - define_const_member_function(__ia__identifier::reverse_const_iterator, rend,) - { - return crend(); - } - - define_const_member_function(__ia__identifier::reverse_const_iterator, crbegin,) - { - return { m_data + m_count - 1 }; - } - - define_const_member_function(__ia__identifier::reverse_const_iterator, crend,) - { - return { m_data - 1 }; + return IIHashable::fnv_1a((PCUINT8)Base::m_data, Base::m_count * sizeof(value_type)); } } diff --git a/Src/IACore/imp/inl/iacore/container/interface/fixed.interface.inl b/Src/IACore/imp/inl/iacore/container/interface/fixed.interface.inl index bd2a48f..f292f25 100644 --- a/Src/IACore/imp/inl/iacore/container/interface/fixed.interface.inl +++ b/Src/IACore/imp/inl/iacore/container/interface/fixed.interface.inl @@ -1,139 +1,175 @@ -// 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 . #pragma once -#include #include #include -#include "iterator.interface.inl" +#include "span.interface.inl" namespace ia { - template, CONST SIZE_T _alignment = 1> - requires valid_allocator_type<_allocator_type, _value_type> - class FixedContainer: public IIHashable - { - public: - using size_type = SIZE_T; - using ssize_type = SSIZE_T; - using value_type = _value_type; - using buffer_type = value_type*; - using pointer_type = value_type*; - using reference_type = value_type&; - using allocator_type = _allocator_type; - using const_pointer_type = CONST value_type*; - using const_reference_type = CONST value_type&; - using iterator = ContainerIterator; - using const_iterator = ContainerConstIterator; - using reverse_iterator = ContainerIterator; - using reverse_const_iterator = ContainerConstIterator; - using comparator_type = std::function; - STATIC CONSTEXPR size_type alignment = _alignment; - - public: - FixedContainer(); - FixedContainer(IN size_type count); - FixedContainer(IN initializer_list v); - FixedContainer(IN FixedContainer&& r) { take_from(IA_MOVE(r)); } - FixedContainer(IN CONST FixedContainer& r) { copy_from(r); } - ~FixedContainer(); + template, + CONST SIZE_T _alignment = 1> + requires valid_allocator_type<_allocator_type, _value_type> + class FixedContainer : public IIHashable, public Span<_value_type> + { + using Base = Span<_value_type>; - VOID operator=(IN FixedContainer&& r) { take_from(IA_MOVE(r)); } - VOID operator=(IN CONST FixedContainer& r) { copy_from(r); } + public: + using typename Base::size_type; + using typename Base::ssize_type; + using typename Base::value_type; + using typename Base::pointer_type; + using typename Base::const_pointer_type; + using typename Base::buffer_type; + using typename Base::reference_type; + using typename Base::const_reference_type; + using typename Base::iterator; + using typename Base::const_iterator; + using typename Base::reverse_iterator; + using typename Base::reverse_const_iterator; + using typename Base::comparator_type; + using allocator_type = _allocator_type; + STATIC CONSTEXPR size_type alignment = _alignment; - public: - iterator begin(); - iterator end(); - const_iterator begin() CONST; - const_iterator end() CONST; - const_iterator cbegin() CONST; - const_iterator cend() CONST; + public: + FixedContainer(); + FixedContainer(IN size_type count); + FixedContainer(IN initializer_list v); - reverse_iterator rbegin(); - reverse_iterator rend(); - reverse_const_iterator rbegin() CONST; - reverse_const_iterator rend() CONST; - reverse_const_iterator crbegin() CONST; - reverse_const_iterator crend() CONST; + FixedContainer(IN FixedContainer &&r) + { + take_from(IA_MOVE(r)); + } - public: - value_type& front() { IA_ASSERT(m_count > 0); return m_data[0]; } - CONST value_type& front() CONST { IA_ASSERT(m_count > 0); return m_data[0]; } - - value_type& back() { IA_ASSERT(m_count > 0); return m_data[m_count - 1]; } - CONST value_type& back() CONST { IA_ASSERT(m_count > 0); return m_data[m_count - 1]; } + FixedContainer(IN CONST FixedContainer &r) + { + copy_from(r); + } - value_type& operator[](IN size_type index) { IA_ASSERT(index < m_count); return m_data[index]; } - CONST value_type& operator[](IN size_type index) CONST { IA_ASSERT(index < m_count); return m_data[index]; } + ~FixedContainer(); - public: - template - iterator find(IN CONST compare_type& v, IN size_type offset = 0); - iterator find(IN comparator_type c, IN size_type offset = 0); - template - iterator rfind(IN CONST compare_type& v, IN size_type offset = 0); - iterator rfind(IN comparator_type c, IN size_type offset = 0); + VOID operator=(IN FixedContainer &&r) + { + take_from(IA_MOVE(r)); + } - template - const_iterator find(IN CONST compare_type& v, IN size_type offset = 0) CONST { return cfind(v, offset); } - const_iterator find(IN comparator_type c, IN size_type offset = 0) CONST { return cfind(c, offset); } - template - const_iterator rfind(IN CONST compare_type& v, IN size_type offset = 0) CONST { return crfind(v, offset); } - const_iterator rfind(IN comparator_type c, IN size_type offset = 0) CONST { return crfind(c, offset); } + VOID operator=(IN CONST FixedContainer &r) + { + copy_from(r); + } - template - const_iterator cfind(IN CONST compare_type& v, IN size_type offset = 0) CONST; - const_iterator cfind(IN comparator_type c, IN size_type offset = 0) CONST; - template - const_iterator crfind(IN CONST compare_type& v, IN size_type offset = 0) CONST; - const_iterator crfind(IN comparator_type c, IN size_type offset = 0) CONST; + public: + value_type &front() + { + IA_ASSERT(Base::m_count > 0); + return Base::m_data[0]; + } - template - BOOL contains(IN CONST compare_type& v) CONST; - BOOL contains(IN CONST comparator_type c) CONST; + CONST value_type &front() CONST + { + IA_ASSERT(Base::m_count > 0); + return Base::m_data[0]; + } - public: - UINT64 hash() CONST; + value_type &back() + { + IA_ASSERT(Base::m_count > 0); + return Base::m_data[Base::m_count - 1]; + } - public: - BOOL operator==(IN CONST FixedContainer& o) CONST; + CONST value_type &back() CONST + { + IA_ASSERT(Base::m_count > 0); + return Base::m_data[Base::m_count - 1]; + } - public: - pointer_type data() { return m_data; } - const_pointer_type CONST data() CONST { return m_data; } - VIRTUAL size_type size() CONST { return m_count; } - VIRTUAL BOOL empty() CONST { return !m_count; } + value_type &operator[](IN size_type index) + { + IA_ASSERT(index < Base::m_count); + return Base::m_data[index]; + } - allocator_type& allocator() { return m_allocator; } - VOID allocator(IN CONST allocator_type& v) { m_allocator = v; } + CONST value_type &operator[](IN size_type index) CONST + { + IA_ASSERT(index < Base::m_count); + return Base::m_data[index]; + } - public: - VIRTUAL VOID reset(); - VIRTUAL pointer_type take(); + public: + template iterator find(IN CONST compare_type &v, IN size_type offset = 0); + iterator find(IN comparator_type c, IN size_type offset = 0); + template iterator rfind(IN CONST compare_type &v, IN size_type offset = 0); + iterator rfind(IN comparator_type c, IN size_type offset = 0); - VIRTUAL VOID take_from(IN FixedContainer&& r); - VIRTUAL VOID copy_from(IN CONST FixedContainer& r); + template const_iterator find(IN CONST compare_type &v, IN size_type offset = 0) CONST + { + return cfind(v, offset); + } - protected: - size_type m_count { 0 }; - buffer_type m_data { nullptr }; + const_iterator find(IN comparator_type c, IN size_type offset = 0) CONST + { + return cfind(c, offset); + } - protected: - allocator_type m_allocator {}; - }; -} + template const_iterator rfind(IN CONST compare_type &v, IN size_type offset = 0) CONST + { + return crfind(v, offset); + } + + const_iterator rfind(IN comparator_type c, IN size_type offset = 0) CONST + { + return crfind(c, offset); + } + + template const_iterator cfind(IN CONST compare_type &v, IN size_type offset = 0) CONST; + const_iterator cfind(IN comparator_type c, IN size_type offset = 0) CONST; + template const_iterator crfind(IN CONST compare_type &v, IN size_type offset = 0) CONST; + const_iterator crfind(IN comparator_type c, IN size_type offset = 0) CONST; + + template BOOL contains(IN CONST compare_type &v) CONST; + BOOL contains(IN CONST comparator_type c) CONST; + + public: + UINT64 hash() CONST; + + public: + BOOL operator==(IN CONST FixedContainer &o) CONST; + + public: + allocator_type &allocator() + { + return m_allocator; + } + + VOID allocator(IN CONST allocator_type &v) + { + m_allocator = v; + } + + public: + VIRTUAL VOID reset(); + VIRTUAL pointer_type take(); + + VIRTUAL VOID take_from(IN FixedContainer &&r); + VIRTUAL VOID copy_from(IN CONST FixedContainer &r); + + protected: + allocator_type m_allocator{}; + }; +} // namespace ia diff --git a/Src/IACore/imp/inl/iacore/container/interface/span.interface.inl b/Src/IACore/imp/inl/iacore/container/interface/span.interface.inl new file mode 100644 index 0000000..568ead8 --- /dev/null +++ b/Src/IACore/imp/inl/iacore/container/interface/span.interface.inl @@ -0,0 +1,84 @@ +// 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 + +#include "iterator.interface.inl" + +namespace ia +{ + template class Span + { + public: + using size_type = SIZE_T; + using ssize_type = SSIZE_T; + using value_type = _value_type; + using pointer_type = value_type *; + using buffer_type = value_type *; + using reference_type = value_type &; + using const_pointer_type = CONST value_type *; + using const_reference_type = CONST value_type &; + using iterator = ContainerIterator; + using const_iterator = ContainerConstIterator; + using reverse_iterator = ContainerIterator; + using reverse_const_iterator = ContainerConstIterator; + using comparator_type = std::function; + + public: + iterator begin(); + iterator end(); + const_iterator begin() CONST; + const_iterator end() CONST; + const_iterator cbegin() CONST; + const_iterator cend() CONST; + + reverse_iterator rbegin(); + reverse_iterator rend(); + reverse_const_iterator rbegin() CONST; + reverse_const_iterator rend() CONST; + reverse_const_iterator crbegin() CONST; + reverse_const_iterator crend() CONST; + + public: + pointer_type data() + { + return m_data; + } + + const_pointer_type CONST data() CONST + { + return m_data; + } + + VIRTUAL size_type size() CONST + { + return m_count; + } + + VIRTUAL BOOL empty() CONST + { + return !m_count; + } + + protected: + size_type m_count{0}; + pointer_type m_data{nullptr}; + }; +} // namespace ia \ No newline at end of file diff --git a/Src/IACore/imp/inl/iacore/container/span.inl b/Src/IACore/imp/inl/iacore/container/span.inl new file mode 100644 index 0000000..774df6f --- /dev/null +++ b/Src/IACore/imp/inl/iacore/container/span.inl @@ -0,0 +1,92 @@ +// 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/span.interface.inl" + +#define __template template +#define __ia__identifier Span<_value_type> +#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(__ia__identifier::iterator, begin,) + { + return cbegin(); + } + + define_member_function(__ia__identifier::iterator, end,) + { + return cend(); + } + + define_member_function(__ia__identifier::reverse_iterator, rbegin,) + { + return crbegin(); + } + + define_member_function(__ia__identifier::reverse_iterator, rend,) + { + return crend(); + } + + define_const_member_function(__ia__identifier::const_iterator, begin,) + { + return cbegin(); + } + + define_const_member_function(__ia__identifier::const_iterator, end,) + { + return cend(); + } + + define_const_member_function(__ia__identifier::const_iterator, cbegin,) + { + return { m_data }; + } + + define_const_member_function(__ia__identifier::const_iterator, cend,) + { + return { m_data + m_count }; + } + + define_const_member_function(__ia__identifier::reverse_const_iterator, rbegin,) + { + return crbegin(); + } + + define_const_member_function(__ia__identifier::reverse_const_iterator, rend,) + { + return crend(); + } + + define_const_member_function(__ia__identifier::reverse_const_iterator, crbegin,) + { + return { m_data + m_count - 1 }; + } + + define_const_member_function(__ia__identifier::reverse_const_iterator, crend,) + { + return { m_data - 1 }; + } +} + +#undef __template +#undef __ia__identifier +#undef define_member_function +#undef define_const_member_function diff --git a/Src/IACore/inc/hpp/iacore/container.hpp b/Src/IACore/inc/hpp/iacore/container.hpp index 49fcb2d..4714de2 100644 --- a/Src/IACore/inc/hpp/iacore/container.hpp +++ b/Src/IACore/inc/hpp/iacore/container.hpp @@ -16,6 +16,7 @@ #pragma once +#include "iacore/container/span.inl" #include "iacore/container/fixed.inl" #include "iacore/container/dynamic.inl" diff --git a/Src/IACore/inc/hpp/iacore/log.hpp b/Src/IACore/inc/hpp/iacore/log.hpp new file mode 100644 index 0000000..f943cc5 --- /dev/null +++ b/Src/IACore/inc/hpp/iacore/log.hpp @@ -0,0 +1,56 @@ +// 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 "iacore/string.hpp" + +namespace ia +{ + class Logger + { + public: + template STATIC VOID Info(Args... args) + { + StringStream ss; + UNUSED((ss << ... << args)); + printf("\033[32m[INFO]: %s\033[39m\n", ss.str().c_str()); + } + + template STATIC VOID Warn(Args... args) + { + StringStream ss; + UNUSED((ss << ... << args)); + printf("\033[33m[WARN]: %s\033[39m\n", ss.str().c_str()); + } + + template 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() + { + } + }; +} // namespace ia \ No newline at end of file diff --git a/Src/IACore/inc/hpp/iacore/iaml.hpp b/Src/IACore/inc/hpp/iacore/span.hpp similarity index 50% rename from Src/IACore/inc/hpp/iacore/iaml.hpp rename to Src/IACore/inc/hpp/iacore/span.hpp index 517716b..aec4053 100644 --- a/Src/IACore/inc/hpp/iacore/iaml.hpp +++ b/Src/IACore/inc/hpp/iacore/span.hpp @@ -1,53 +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 . #pragma once -#include "file.hpp" +#include "iacore/container/span.inl" namespace ia { - class IAML - { - public: - - - public: - IAML(IN CONST String& path) { ParseFromFile(path); } - ~IAML() {} - - private: - VOID ParseFromFile(IN CONST String& path); - VOID ParseFromMemory(IN CONST String& iaml); - }; -} - -namespace ia -{ - VOID IAML::ParseFromFile(IN CONST String& path) - { - File f(path, File::OPEN_FLAG_READ); - String data; - data.resize(f.Size() + 1); - f.Read(data.data(), f.Size(), f.Size()); - ParseFromMemory(data); - } - - VOID IAML::ParseFromMemory(IN CONST String& iaml) - { - - } } \ No newline at end of file diff --git a/Src/IACoreTest/imp/cpp/Main.cpp b/Src/IACoreTest/imp/cpp/Main.cpp index b15d0a3..0ca45f0 100644 --- a/Src/IACoreTest/imp/cpp/Main.cpp +++ b/Src/IACoreTest/imp/cpp/Main.cpp @@ -1,7 +1,21 @@ -#include +#include +#include + +#include + +using namespace ia; + +VOID print(IN CONST Span& s) +{ + for(const auto& v: s) + Logger::Info(v); +} int main(int argc, char* argv[]) { - + Vector v1{10, 20, 32}; + + print(v1); + return 0; } \ No newline at end of file diff --git a/Src/IACoreTest/res/sample.txt b/Src/IACoreTest/res/sample.txt new file mode 100644 index 0000000..2de6e7a --- /dev/null +++ b/Src/IACoreTest/res/sample.txt @@ -0,0 +1,4 @@ +Hello +W +o +rld