8 #include <system/enumerator_adapter.h>
9 #include <system/default.h>
10 #include <system/collections/list.h>
11 #include <system/collections/ilist.h>
12 #include <system/collections/ienumerable.h>
13 #include <system/collections/icomparer.h>
14 #include <system/collections/icollection.h>
15 #include <system/array.h>
17 #include "aspose.tasks.cpp/Util/ICondition.h"
18 #include "aspose.tasks.cpp/Util/IAlgorithm.h"
19 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
29 class GroupCollection;
36 class AgilePasswordVerifier;
37 class MPP14StreamEncryptorDecryptorBase;
42 class FixedDataOffsets;
45 class Mpp12CalendarWriter;
46 class MPP12TaskReader;
47 class MPP14TaskReader;
48 class Mpp9CalendarWriter;
49 class MPP9ExtendedAttributeDefinitionWriter;
50 class MPP9OutlineCodeDefinitionWriter;
51 class MPPExtendedAttributeWriter;
53 class MPPOutlineCodeDefinitionWriter;
54 class MppPdfOleObjectWriter;
55 class MppTimephasedDataWriter;
58 namespace PrimaveraXml
60 class PrimaveraReader;
63 class OptimizedForSearchingTimephasedDataCollection;
64 class PluginLicensesHelper;
68 class TemplateProjectLoader;
69 class XerRelationTable;
91 friend class Aspose::Tasks::IO::MSProject::Metadata::VarDataOffsets;
92 friend class Aspose::Tasks::IO::MSProject::Decryptor::MPP14StreamEncryptorDecryptorBase;
93 friend class Aspose::Tasks::IO::MSProject::Metadata::FixedDataOffsets;
94 friend class Aspose::Tasks::IO::MSProject::MppPdfOleObjectWriter;
95 friend class Aspose::Tasks::IO::MSProject::MppGroupWriter;
96 friend class Aspose::Tasks::IO::PrimaveraXml::PrimaveraReader;
97 friend class Aspose::Tasks::PluginLicensesHelper;
98 friend class Aspose::Tasks::Saving::TemplateProjectLoader;
100 friend class Aspose::Tasks::IO::MSProject::Decryptor::AgilePasswordVerifier;
101 friend class Aspose::Tasks::IO::MSProject::MPP12TaskReader;
102 friend class Aspose::Tasks::IO::MSProject::MPP14TaskReader;
103 friend class Aspose::Tasks::IO::MSProject::FixedWriter;
104 friend class Aspose::Tasks::IO::MSProject::Mpp12CalendarWriter;
105 friend class Aspose::Tasks::IO::MSProject::MPPExtendedAttributeWriter;
106 friend class Aspose::Tasks::IO::MSProject::MPPOutlineCodeDefinitionWriter;
107 friend class Aspose::Tasks::IO::MSProject::Mpp9CalendarWriter;
108 friend class Aspose::Tasks::IO::MSProject::MPP9ExtendedAttributeDefinitionWriter;
109 friend class Aspose::Tasks::IO::MSProject::MPP9OutlineCodeDefinitionWriter;
110 friend class Aspose::Tasks::IO::MSProject::MppTimephasedDataWriter;
111 friend class Aspose::Tasks::IO::MSProject::VarVarWriter;
112 friend class Aspose::Tasks::OptimizedForSearchingTimephasedDataCollection;
113 friend class Aspose::Tasks::Saving::MpxSavingUtils;
114 friend class Aspose::Tasks::Saving::XerRelationTable;
115 friend class Aspose::LicenseV2::LicenseCore;
126 template <
typename T>
127 static void Apply(
const System::SharedPtr<System::Collections::Generic::IList<T>>& list,
const System::SharedPtr<
IAlgorithm<T>>& algorithm, int32_t startIndex)
129 for (int32_t i = startIndex; i < list->get_Count(); i++)
131 T el = list->idx_get(i);
132 algorithm->PreAlg(el, i);
133 algorithm->Alg(el, i);
134 algorithm->PostAlg(el, i);
145 template <
typename T>
146 static System::SharedPtr<System::Collections::Generic::IList<T>>
Filter(
const System::SharedPtr<System::Collections::Generic::IList<T>>& list,
const System::SharedPtr<
ICondition<T>>& cond)
148 System::SharedPtr<System::Collections::Generic::IList<T>> result = System::MakeObject<System::Collections::Generic::List<T>>();
149 for (int32_t i = 0; i < list->get_Count(); i++)
151 if (cond->Check(list->idx_get(i)))
153 result->Add(list->idx_get(i));
167 template <
typename T>
168 static T
Find(
const System::SharedPtr<System::Collections::Generic::IList<T>>& list,
const System::SharedPtr<
ICondition<T>>& cond)
170 for (int32_t i = 0; i < list->get_Count(); i++)
172 if (cond->Check(list->idx_get(i)))
174 return list->idx_get(i);
178 return System::Default<T>();
184 static ASPOSE_TASKS_SHARED_API
void Resize(System::ArrayPtr<uint8_t>& array, int32_t newSize);
185 static ASPOSE_TASKS_SHARED_API System::ArrayPtr<uint8_t> Concat(
const System::ArrayPtr<uint8_t>& arr1,
const System::ArrayPtr<uint8_t>& arr2);
186 static ASPOSE_TASKS_SHARED_API
bool Equal(
const System::ArrayPtr<uint8_t>& arr1,
const System::ArrayPtr<uint8_t>& arr2);
187 static ASPOSE_TASKS_SHARED_API
bool IsBlank(
const System::ArrayPtr<uint8_t>& arr);
188 static ASPOSE_TASKS_SHARED_API
bool IsBlank(ByteSpan span);
189 template <
typename T>
190 static System::SharedPtr<System::Collections::Generic::List<T>> ToList(
const System::SharedPtr<System::Collections::Generic::IEnumerable<T>>& sequence)
192 System::SharedPtr<System::Collections::Generic::List<T>> result = System::MakeObject<System::Collections::Generic::List<T>>();
193 for (
auto&& element : System::IterateOver(sequence))
195 result->Add(element);
201 template <
typename T>
202 static int32_t BinarySearch(
const System::SharedPtr<System::Collections::Generic::IList<T>>& array, int32_t index, int32_t length, T value,
const System::SharedPtr<System::Collections::Generic::IComparer<T>>& comparer)
205 int32_t num2 = index + length - 1;
208 int32_t num3 = num + ((num2 - num) >> 1);
209 int32_t num4 = comparer->Compare(array->idx_get(num3), value);
228 template <
typename T>
229 static void CopyElements(
const System::SharedPtr<System::Collections::Generic::ICollection<T>>& source,
const System::SharedPtr<System::Collections::Generic::ICollection<T>>& target)
231 for (
auto&& element : System::IterateOver(source))
233 target->Add(element);
239 ListUtils() =
delete;