2.2.4.32.13 OriginObject::GetBinaryStorage

Description

Get a binary storage as a tree

Syntax

BOOL GetBinaryStorage( LPCSTR lpcszName, TreeNode & tn, int * pnSize = NULL )

Parameters

lpcszName
[input] name of the binary storage
tn
[output] put results into this treenode
pnSize
[output] storage size

Return

true if found, false if not found.

Examples

EX1

void OriginObject_GetBinaryStorage_Ex1(string strStorageName = "SomeJunk")
{
    Page pg = Project.Pages();
    Tree tr;
    if(pg.GetBinaryStorage(strStorageName, tr))
        out_tree(tr);
    else
        out_str("not found");
}

EX2

//print out all columns that has a storage in the Dataset and show the size.
void GetBinaryStorage_ex2()
{
	Worksheet wks = Project.ActiveLayer();
	if( wks )
	{
		foreach(Column col in wks.Columns)
		{
			DatasetObject ds(col);
			int nSize;
			ds.GetBinaryStorage(NULL, NULL, &nSize);
			if( nSize > 0 )// The size returned is total size of all binary storage objects when saved to OPJ. 
				printf("%s (%d bytes)\n", col.GetName(), nSize);
		}
	}
}

Remark

See Also

OriginObject::PutBinaryStorage, get_user_info, set_user_info

Header to Include

origin.h