/********************************* This is the file WinTreeCondition.cpp == Windows Last Left Threaded Data Tree Condition. It holds functions and method bodies that report back the current overall condition of the tree. Functions: bool DoesTreeExist(TreeData* pTD) { *********************************/ #include "WinTree.h" // WinTree1.h is 'ifndef' so wont be multipled defind // ********************************************************* // ++++++++++++ BEGIN function DoesTreeExist +++++++++++++++ /**** One; test if tree exist, Two; test if new tree node data is valid for this tree. Test two is done as a safety check, pTD-FetchPointerToRoot() may have a bad pointer, but a pointer is a pointer, so cursory test of node data is done. In ASCII and UNICODE A...Za...z is between 64 and 123 in DEC values. ****/ bool DoesTreeExist(TreeData* pTD) { if( pTD->FetchPointerToRoot() == NULL ) { return false; } else { TCHAR *szTreeNodeData = (pTD->FetchPointerToRoot())->FetchTreeNodeData() ; if( (int)*szTreeNodeData <= 64 || (int)*szTreeNodeData >= 123 ) return false; } return true; } // End FetchTreeData... // ------------ END function DoesTreeExist ----------------- // *********************************************************