newntui/discovermdi/src/disgraphnode.cpp
//------------------------------------------------------------------------------------
// This private function will parse the results of the node creation script send as 
// a string of '/n' separated node IDs. It will allocate memory for the array of
// node IDs and it will place all node ID's in this array. It is your task to free
// this array when no longer needed.
//------------------------------------------------------------------------------------
This private function will parse the results of the node creation script send as
a string of '/n' separated node IDs. It will allocate memory for the array of
node IDs and it will place all node ID's in this array. It is your task to free
this array when no longer needed.
This private function will parse the results of the node creation script send as a string of ' / n ' separated node IDs . It will allocate memory for the array of node IDs and it will place all node ID ' s in this array . It is your task to free this array when no longer needed .
int CDisGraph::ParseCreationResults(CString &str, int** IDs) {
register i;
int     idCounter;
CString val;
    idCounter=0;
	for(i=0;i<str.GetLength();i++) {
		if(str[i]=='\n') idCounter++;
	}
	if(idCounter==0) return 0;
	*IDs = new int [idCounter];
    idCounter=0;
	val="";
	for(i=0;i<str.GetLength();i++) {
		if(str[i]=='\n') {
			int id = atoi(val);
			(*IDs)[idCounter]=id;
			val="";
			idCounter++;
			continue;
		}
		val+=str[i];
	}
	return idCounter;
}
int CDisGraph :: ParseCreationResults ( CString & str , int * * IDs ) { register i ; int idCounter ; CString val ; idCounter = 0 ; for ( i = 0 ; i < str . GetLength ( ) ; i ++ ) { if ( str [ i ] == ' \n ' ) idCounter ++ ; } if ( idCounter == 0 ) return 0 ; * IDs = new int [ idCounter ] ; idCounter = 0 ; val = " " ; for ( i = 0 ; i < str . GetLength ( ) ; i ++ ) { if ( str [ i ] == ' \n ' ) { int id = atoi ( val ) ; ( * IDs ) [ idCounter ] = id ; val = " " ; idCounter ++ ; continue ; } val += str [ i ] ; } return idCounter ; }
This private function will parse the results of the node creation script send as
a string of '/n' separated node IDs.
This private function will parse the results of the node creation script send as a string of ' / n ' separated node IDs .