summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeat Forster <bfo@synthesis.ch>2009-05-04 11:13:32 +0200
committerLukas Zeller <luz@synthesis.ch>2009-05-04 11:13:32 +0200
commit3073541322c3061401ad21f16435a96b8543a103 (patch)
treeaaf7c3a05945fe190d4c23e662166956ea3692ae
parent3ffdf5318d9ca921932da66d602b81239656b7dc (diff)
SDK_support: Added CLine:GetName()
-rwxr-xr-xsrc/sysync_SDK/Sources/SDK_support.cpp17
-rwxr-xr-xsrc/sysync_SDK/Sources/SDK_support.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/src/sysync_SDK/Sources/SDK_support.cpp b/src/sysync_SDK/Sources/SDK_support.cpp
index 4000aba..f845b17 100755
--- a/src/sysync_SDK/Sources/SDK_support.cpp
+++ b/src/sysync_SDK/Sources/SDK_support.cpp
@@ -231,7 +231,22 @@ void CLine::StrOpt( char opt, int n, string &value )
} while (*s!='\0' && *s!=' ');
} // if
} // for
-} // StrOpt;
+} // StrOpt
+
+
+void CLine::GetName( int n, string &value )
+{
+ int j= 0;
+
+ for (int i=1; i<fArgc; i++) {
+ string s= fArgv[ i ];
+ if (s.find( '-',0 )!=0) { // search for params
+ j++;
+ if (j==n) { value= s; return; }
+ } // if
+ } // for
+} // GetName
+
bool CLine::NextOpt( char opt, int &n, string &value )
diff --git a/src/sysync_SDK/Sources/SDK_support.h b/src/sysync_SDK/Sources/SDK_support.h
index 65a074f..2502fb0 100755
--- a/src/sysync_SDK/Sources/SDK_support.h
+++ b/src/sysync_SDK/Sources/SDK_support.h
@@ -68,6 +68,7 @@ class CLine
void InitOptions( int argc, char* argv[] ); // assign command line arguments
void StrOpt ( char opt, int n, string &value ); // Get <n>th option string of <opt>
+ void GetName ( int n, string &value );
bool NextOpt ( char opt, int &n, string &value ); // Get next option, if available
void IntOpt ( char opt, int n, uInt32 &value );