]> git.stg.codes - stg.git/commitdiff
Added specialization for std::string of Value2OS
authorMaxim Mamontov <faust.madf@gmail.com>
Mon, 8 Aug 2011 18:27:33 +0000 (21:27 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Mon, 8 Aug 2011 18:27:33 +0000 (21:27 +0300)
projects/stargazer/plugins/other/smux/value2os.h

index 20e624059c99d0cc38611b2a91d5e59c3bbbd4c9..d17cb3574ba80579bd2d27351eaf5eb241c5f917 100644 (file)
@@ -50,4 +50,15 @@ asn_long2INTEGER(&simpleSyntax->choice.number, value);
 return true;
 }
 
+template <>
+inline
+bool ValueToOS<std::string>(const std::string & value, ObjectSyntax * objectSyntax)
+{
+objectSyntax->present = ObjectSyntax_PR_simple;
+SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple;
+simpleSyntax->present = SimpleSyntax_PR_string;
+OCTET_STRING_fromBuf(&simpleSyntax->choice.string, value.c_str(), value.length());
+return true;
+}
+
 #endif