pge_test.cpp
来自「支持各种栅格图像和矢量图像读取的库」· C++ 代码 · 共 73 行
CPP
73 行
/****************************************************************************** * $Id: pge_test.cpp 10646 2007-01-18 02:38:10Z warmerdam $ * * Project: DGN Tag Read/Write Bindings for Pacific Gas and Electric * Purpose: Test mainline program. * Author: Frank Warmerdam, warmerdam@pobox.com * ****************************************************************************** * Copyright (c) 2002, Pacific Gas and Electric Co, San Franciso, CA, USA. * * All rights reserved. Not to be used, reproduced or disclosed without * permission. ****************************************************************************/#include "dgn_pge.h"#include "cpl_string.h"CPL_CVSID("$Id: pge_test.cpp 10646 2007-01-18 02:38:10Z warmerdam $");/************************************************************************//* main() *//************************************************************************/int main( int nArgc, char **papszArgv ){ char **papszTagSets = NULL; char **papszTagNames = NULL; char **papszTagValues = NULL; if( nArgc >= 3 && EQUAL(papszArgv[1],"-r") ) { if( DGNReadTags( papszArgv[2], 0, &papszTagSets, &papszTagNames, &papszTagValues ) ) { int nItems = CSLCount(papszTagSets); for( int i = 0; i < nItems; i++ ) printf( " %s:%s = %s\n", papszTagSets[i], papszTagNames[i], papszTagValues[i] ); CSLDestroy( papszTagSets ); CSLDestroy( papszTagNames ); CSLDestroy( papszTagValues ); } else printf( "DGNReadTags() returned an error.\n" ); } else if( nArgc >= 6 && EQUAL(papszArgv[1],"-w") ) { for( int i = 3; i < nArgc; i += 3 ) { papszTagSets = CSLAddString( papszTagSets, papszArgv[i] ); papszTagNames = CSLAddString( papszTagNames, papszArgv[i+1] ); papszTagValues = CSLAddString( papszTagValues, papszArgv[i+2] ); } if( !DGNWriteTags( papszArgv[2], 0, papszTagSets, papszTagNames, papszTagValues ) ) printf( "DGNWriteTags() failed.\n" ); else printf( "DGNWriteTags() succeeded\n" ); } else { printf( "Usage: pge_test -r filename\n" ); printf( " or pge_test -w filename [tagset tag value]*\n" ); } return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?