src/libYARP_OS/src/mesh.cpp
int Mesh::Load ( istream& is, int style )
{
	char
		buf[YARP_STRING_LEN];
	int
		verbose = ( ( style & FORMAT ) == PROSE_FORMAT ),
		failed = 0,
		done = 0;
	YARPString
		label,
		srcLabel,
		destLabel;
	MeshLink
		*link;

	do
	{
    	is >> buf;
		label = buf;

		if ( !(label == NullName ) )
		{
			if ( verbose )	is >> buf;		//	Eliminate "FROM"

			is >> buf;
			srcLabel = buf;
			if ( verbose )	is >> buf;		//	Eliminate "TO"

			is >> buf;
			destLabel = buf;
			if ( verbose )	is >> buf;		//	Eliminate "("

			link = AddLink ( label, srcLabel, destLabel );
			if ( link != NULL )
			{
				if ( !link->Read ( is, style ) )
				{
					//	Failed
					failed = 1;
				}
				else
            	{
					if ( verbose )	is >> buf;	//	Eliminate ")"
				}
			}
		}
		else
		{
			if ( verbose )
            {
				is >> buf;					//	Eliminate ":"
				is >> buf;					//	Eliminate "EndOfMesh"
            }
			done = 1;
		}
		if ( is.eof() )	{	done = 1;	}
	} while ( !done && !failed );

	return !failed;
}
/*-----------------------------------------------------------------------------
Function	Load
                                                                           
Description	Loads a mesh from a stream.

Input		is				Input stream to read from.
			style			Style in which the mesh is assumed to be
							described.
							This is a combination of
								PROSE_FORMAT or CONCISE_FORMAT
							and
								MINIMAL_CONTENT or EXHAUSTIVE_CONTENT.

Returns		True if no error while loading, false on error
-----------------------------------------------------------------------------*/
Function        Load
Description     Loads a mesh from a stream.

Input           is                              Input stream to read from.
style                   Style in which the mesh is assumed to be
described.

Returns         True if no error while loading, false on error
Function Load Description Loads a mesh from a stream . Input is Input stream to read from . style Style in which the mesh is assumed to be described . Returns True if no error while loading false on error
int Mesh::Load ( istream& is, int style )
{
	char
		buf[YARP_STRING_LEN];
	int
		verbose = ( ( style & FORMAT ) == PROSE_FORMAT ),
		failed = 0,
		done = 0;
	YARPString
		label,
		srcLabel,
		destLabel;
	MeshLink
		*link;
	do
	{
    	is >> buf;
		label = buf;
		if ( !(label == NullName ) )
		{
			if ( verbose )	is >> buf;		
			is >> buf;
			srcLabel = buf;
			if ( verbose )	is >> buf;		
			is >> buf;
			destLabel = buf;
			if ( verbose )	is >> buf;		
			link = AddLink ( label, srcLabel, destLabel );
			if ( link != NULL )
			{
				if ( !link->Read ( is, style ) )
				{
					failed = 1;
				}
				else
            	{
					if ( verbose )	is >> buf;	
				}
			}
		}
		else
		{
			if ( verbose )
            {
				is >> buf;					
				is >> buf;					
            }
			done = 1;
		}
		if ( is.eof() )	{	done = 1;	}
	} while ( !done && !failed );
	return !failed;
}
int Mesh :: Load ( istream & is , int style ) { char buf [ YARP_STRING_LEN ] ; int verbose = ( ( style & FORMAT ) == PROSE_FORMAT ) , failed = 0 , done = 0 ; YARPString label , srcLabel , destLabel ; MeshLink * link ; do { is >> buf ; label = buf ; if ( ! ( label == NullName ) ) { if ( verbose ) is >> buf ; is >> buf ; srcLabel = buf ; if ( verbose ) is >> buf ; is >> buf ; destLabel = buf ; if ( verbose ) is >> buf ; link = AddLink ( label , srcLabel , destLabel ) ; if ( link != NULL ) { if ( ! link -> Read ( is , style ) ) { failed = 1 ; } else { if ( verbose ) is >> buf ; } } } else { if ( verbose ) { is >> buf ; is >> buf ; } done = 1 ; } if ( is . eof ( ) ) { done = 1 ; } } while ( ! done && ! failed ) ; return ! failed ; }
Function        Load
Description     Loads a mesh from a stream.
Function Load Description Loads a mesh from a stream .
//	Eliminate "FROM" //	Eliminate "TO" //	Eliminate "(" //	Failed //	Eliminate ")" //	Eliminate ":" //	Eliminate "EndOfMesh"