32 for (int32_t i = 0; i < iSize; i++)
33 pData[i].Set(ValueArray2.
GetItem(i));
38 delete[] pData; pData =
nullptr;
39 iSize = iCapacity = 0;
45 for (int32_t i = 0; i < iSize; i++)
46 pData[i].Set(ValueArray2.
GetItem(i));
68 bool operator ()(int32_t n1, int32_t n2) {
return rSorter.
CompareCache(n1, n2, pVals[n1]._getObj(), pVals[n2]._getObj()) > 0; }
77 intptr_t i, *pPos =
new intptr_t[iSize];
78 for (i = 0; i < iSize; i++) pPos[i] = i;
82 for (i = 0; i <
iSize; i++)
83 pPos[i] =
reinterpret_cast<intptr_t
>(pData[pPos[i]]._getObj());
85 for (i = 0; i <
iSize; i++)
86 pData[i].SetPropList(
reinterpret_cast<C4PropList *
>(pPos[i]));
101 return v2.
getStr() !=
nullptr;
127 if (descending) std::reverse(pData, pData+iSize);
148 for (int32_t i=0; i<iSize; ++i)
149 if (!pData[i].getPropList())
153 if (descending) std::reverse(pData, pData+
iSize);
169 assert(element_idx>=0);
173 for (int32_t i=0; i<iSize; ++i)
175 if (!pData[i].getArray())
177 if (pData[i]._getArray()->
GetSize() <= element_idx)
182 if (descending) std::reverse(pData, pData+
iSize);
193 assert(iElem < iSize);
205 iElem = iSize + iElem;
206 else if (iElem >= iSize && iElem <
MaxSize) this->
SetSize(iElem + 1);
216 if(inSize == iSize)
return;
220 if (inSize <= iCapacity)
223 for (
int i=inSize; i<iSize; i++) pData[i].Set0();
237 for (i=0; i<iSize; i++)
238 pnData[i] = pData[i];
243 iSize = iCapacity = inSize;
248 for (int32_t i=0; i<std::max(iSize, IntList2.
GetSize()); i++)
257 delete[] pData; pData =
nullptr;
258 iSize = iCapacity = 0;
263 for (int32_t i = 0; i < iSize; i++)
269 int32_t inSize = iSize;
272 { pComp->
Value(inSize); }
274 {
Reset();
delete pExc;
return; }
288 if (startIndex > iSize) startIndex = iSize;
289 else if (startIndex < -iSize)
throw C4AulExecError(
"array slice: start index out of range");
290 else if (startIndex < 0) startIndex += iSize;
292 if (endIndex > iSize) endIndex = iSize;
293 else if (endIndex < -iSize)
throw C4AulExecError(
"array slice: end index out of range");
294 else if (endIndex < 0) endIndex += iSize;
297 for (
int i = startIndex; i < endIndex; ++i)
298 NewArray->pData[i - startIndex] = pData[i];
309 if(startIndex < 0) startIndex += iSize;
310 if(endIndex < 0) endIndex += iSize;
313 if(startIndex < 0)
throw C4AulExecError(
"array slice: start index out of range");
314 if(endIndex < 0)
throw C4AulExecError(
"array slice: end index out of range");
315 if(endIndex < startIndex)
316 endIndex = startIndex;
324 int32_t iNewEnd = std::min(startIndex + Other.
GetSize(), (int32_t)
MaxSize);
325 int32_t iNewSize = iNewEnd;
327 iNewSize += iSize - endIndex;
328 iNewSize = std::min(iNewSize, (int32_t)
MaxSize);
329 int32_t iOtherSize = Other.
GetSize();
331 if(iNewSize != iSize)
336 if(iNewSize > iCapacity)
338 pnData =
new C4Value [iNewSize];
341 for(i = 0; i < startIndex && i < iSize; ++i)
342 pnData[i] = pData[i];
346 for(i = iNewEnd, j = endIndex; i < iNewSize; ++i, ++j)
349 pnData[i] = pData[j];
356 for(i = iNewEnd - 1, j = iNewEnd - startIndex - 1; i >= startIndex; --i, --j)
358 assert(j < iOtherSize);
359 pnData[i] = Other.pData[j];
367 iCapacity = iSize = iNewSize;
372 for(i = iNewSize; i < iSize; ++i)
379 for(int32_t i = startIndex, j = 0; j < iOtherSize; i++, j++)
380 pData[i] = Other.pData[j];
383 if(endIndex >
MaxSize) endIndex = iSize;
386 if(endIndex > iSize)
SetSize(endIndex);
389 for(int32_t i = startIndex; i < endIndex; i++)
StdArrayAdapt< T, M > mkArrayAdaptMap(T *pArray, int iSize, M &&map)
StdParameterAdaptMaker< P > mkParAdaptMaker(P &&rPar)
virtual bool GetPropertyByS(const C4String *k, C4Value *pResult) const
virtual int32_t Compare(C4Object *pObj1, C4Object *pObj2)=0
virtual bool PrepareCache(const C4ValueArray *pObjs)
virtual int32_t CompareCache(int32_t iObj1, int32_t iObj2, C4Object *pObj1, C4Object *pObj2)
C4SortObjectSTLCache(C4SortObject &rSorter, C4Value *pVals)
bool operator()(int32_t n1, int32_t n2)
bool operator()(const C4Value &v1, const C4Value &v2)
C4SortObjectSTL(C4SortObject &rSorter)
StdStrBuf GetData() const
const char * GetCStr() const
const C4Value & GetItem(int32_t iElem) const
void Denumerate(C4ValueNumbers *)
bool SortByProperty(C4String *prop_name, bool descending=false)
void Sort(class C4SortObject &rSort)
C4ValueArray & operator=(const C4ValueArray &)
void CompileFunc(class StdCompiler *pComp, C4ValueNumbers *)
void SetSlice(int32_t startIndex, int32_t endIndex, const C4Value &Val)
void SetSize(int32_t inSize)
C4Value operator[](int32_t iElem) const
void SetItem(int32_t iElemNr, const C4Value &Value)
C4ValueArray * GetSlice(int32_t startIndex, int32_t endIndex)
bool SortByArrayElement(int32_t array_idx, bool descending=false)
bool operator==(const C4ValueArray &) const
ALWAYS_INLINE bool CheckConversion(C4V_Type vtToType) const
C4PropList * _getPropList() const
C4String * getStr() const
C4ValueArray * _getArray() const
C4String * _getStr() const
C4Object * _getObj() const
virtual bool Separator(Sep eSep=SEP_SEP)
void Value(const T &rStruct)
virtual bool isDeserializer()
C4ValueArraySortcomp value_sort
bool operator()(const C4Value &v1, const C4Value &v2)
C4ValueArraySortArrayElementcomp(int32_t element_idx)
C4ValueArraySortcomp value_sort
bool operator()(const C4Value &v1, const C4Value &v2)
C4ValueArraySortPropertycomp(C4String *prop_name)
bool operator()(const C4Value &v1, const C4Value &v2)
bool operator()(const C4Value &v1, const C4Value &v2)