C4ValueArraySortcomp Struct Reference

Public Member Functions

bool operator() (const C4Value &v1, const C4Value &v2)

Detailed Description

Definition at line 111 of file C4ValueArray.cpp.

Member Function Documentation

◆ operator()()

bool C4ValueArraySortcomp::operator() ( const C4Value v1,
const C4Value v2 

Definition at line 113 of file C4ValueArray.cpp.

References C4Value::_getInt(), C4Value::_getStr(), C4V_Int, C4Value::CheckConversion(), C4String::GetData(), and C4Value::getStr().

114  {
115  // sort by whatever type the values have
116  if (v1.getStr() && v2.getStr()) return v1._getStr()->GetData() < v2._getStr()->GetData();
117  if (v1.CheckConversion(C4V_Int) && v2.CheckConversion(C4V_Int)) return v1._getInt() < v2._getInt();
118  return false;
119  }
C4String * getStr() const
Definition: C4Value.h:117
StdStrBuf GetData() const
Definition: C4StringTable.h:50
int32_t _getInt() const
Definition: C4Value.h:122
C4String * _getStr() const
Definition: C4Value.h:126
ALWAYS_INLINE bool CheckConversion(C4V_Type vtToType) const
Definition: C4Value.h:189
Here is the call graph for this function:

The documentation for this struct was generated from the following file: