Author: sayer
Date: 2009-02-10 12:28:37 +0100 (Tue, 10 Feb 2009)
New Revision: 1256

Modified:
   trunk/core/AmArg.cpp
   trunk/core/AmArg.h
Log:
add erase function. fix size() for struct

Modified: trunk/core/AmArg.cpp
===================================================================
--- trunk/core/AmArg.cpp        2009-02-01 17:31:05 UTC (rev 1255)
+++ trunk/core/AmArg.cpp        2009-02-10 11:28:37 UTC (rev 1256)
@@ -180,10 +180,13 @@
 }
 
 const size_t AmArg::size() const {
-  if ((Array != type) && (Struct != type))
-    throw TypeMismatchException();
+  if (Array == type)
+    return v_array->size(); 
 
-  return v_array->size(); 
+  if (Struct == type)
+    return v_struct->size(); 
+
+  throw TypeMismatchException();
 }
 
 AmArg& AmArg::get(size_t idx) {
@@ -281,6 +284,10 @@
   return v_struct->end();
 }
 
+void AmArg::erase(const char* name) {
+  assertStruct();
+  v_struct->erase(name);
+}
 
 void AmArg::assertArrayFmt(const char* format) const {
   size_t fmt_len = strlen(format);

Modified: trunk/core/AmArg.h
===================================================================
--- trunk/core/AmArg.h  2009-02-01 17:31:05 UTC (rev 1255)
+++ trunk/core/AmArg.h  2009-02-10 11:28:37 UTC (rev 1256)
@@ -261,6 +261,9 @@
   ValueStruct::const_iterator begin() const;
   ValueStruct::const_iterator end() const;
 
+  /** remove struct member */
+  void erase(const char* name);
+
   /** 
    * throws exception if arg array does not conform to spec 
    *   i  - int 

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to