2.2.4.32.30 OriginObject::GetStorageNames

Description

Get names of storage class objects

Syntax

BOOL GetStorageNames( vector<string> & vsNamesn, int nType = STORAGE_TYPE_ALL )

Parameters

vsNamesn
[output]returns name of the storages in the object;
nType
[optional] defines the type of the storage requested. Could be one the following
STORAGE_TYPE_INI: Only INI storages.
STORAGE_TYPE_BINARY: Only binary storages.
STORAGE_TYPE_ALL: Both Binary and INI storages.

Return

Examples

EX1

// Check for all storage on the active page
// Import data using the Import Wizard to ensure creation of system storage object
// Import a sound (WAV) file to create a WAVE storage
void GetStorageNames_Ex1()
{
    Page pg = Project.Pages();
    Tree tr;
    storage st;
    vector<string> vsStoreNames;
 
    BOOL bRes = pg.GetStorageNames(vsStoreNames, STORAGE_TYPE_INI);
    if( bRes )
    {
        for( int ii = 0 ; ii < vsStoreNames.GetSize() ; ii++ )
        {
            printf("%u : %s\n", ii, vsStoreNames[ii]);
            st = pg.GetStorage(vsStoreNames[ii]);
            if( st )
            {
                vector<string> vsNames;
                if(st.GetSectionNames(vsNames))
                {
                    for(int ii = 0; ii < vsNames.GetSize(); ii++)
		    		{
	                	printf("Section:%s\n", vsNames[ii]);
		        		Tree tr;
		        		if(st.GetSection(vsNames[ii], tr))
		        			out_tree(tr);
		    		}
	        	}
	    	}
        }
    }
}

Remark

Get names of storage class objects.

See Also

OriginObject::GetStorage

Header to Include

origin.h