Important Update:

- DataTreeCore:
  - Re-arrange method declaration order
  - Renamed methods Delete() to DeleteCh()
  - Added GetChName(), GetChType(), GetChLen() & ClearCh(Path) methods
- ApplicationCore:
  - Add WriteToScreen() method (Hide access to JSONparser)
This commit is contained in:
Charl Wentzel
2018-11-27 09:56:27 +02:00
parent 277798a008
commit 83c192c1a6
4 changed files with 64 additions and 35 deletions

View File

@@ -130,18 +130,33 @@ CDataMember * CDataMember::CreateChild( const char * Name, const int Len )
bool CDataMember::Clear()
{
// Clear value
if (Value) {
free( Value );
Value = NULL;
}
// Clear children
while (FirstChild) {
delete FirstChild;
// FirstChild = NULL;
// LastChild = NULL;
// Len = 0;
}
Type = jtNull;
// Reset value
Type = jtNull;
return true;
}
//---------------------------------------------------------------------------
bool CDataMember::ClearCh( const char * Path )
{
CDataMember * Child = NULL;
// Find member
if (!(Child = (!Path || !*Path)? this : GetChild( Path, false )))
return false;
// Clear
Child->Clear();
return true;
}
//---------------------------------------------------------------------------
@@ -318,7 +333,7 @@ CDataMember * CDataMember::GetChElement( const char * Path, const int Index, boo
}
//---------------------------------------------------------------------------
bool CDataMember::Delete( const char * Path )
bool CDataMember::DeleteCh( const char * Path )
{
CDataMember * Member;
@@ -484,7 +499,7 @@ bool CDataMember::SetChNull( const char * Path )
}
//---------------------------------------------------------------------------
const char * CDataMember::GetName( const char * Path )
const char * CDataMember::GetChName( const char * Path )
{
CDataMember * Member;
@@ -496,7 +511,7 @@ const char * CDataMember::GetName( const char * Path )
}
//---------------------------------------------------------------------------
EDataType CDataMember::GetType( const char * Path )
EDataType CDataMember::GetChType( const char * Path )
{
CDataMember * Member;
@@ -508,7 +523,7 @@ EDataType CDataMember::GetType( const char * Path )
}
//---------------------------------------------------------------------------
const int CDataMember::GetLen( const char * Path )
const int CDataMember::GetChLen( const char * Path )
{
CDataMember * Member;