summaryrefslogtreecommitdiff
path: root/libodbcpp/string.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2006-07-08 16:32:05 +0000
committerrandomdan <randomdan@localhost>2006-07-08 16:32:05 +0000
commit2a1fa15d8baa4eda37e17b2e9362f8bde17a939d (patch)
tree09386e52320b7c52a521ab56fc7553896e639dcd /libodbcpp/string.cpp
downloadlibdbpp-odbc-2a1fa15d8baa4eda37e17b2e9362f8bde17a939d.tar.bz2
libdbpp-odbc-2a1fa15d8baa4eda37e17b2e9362f8bde17a939d.tar.xz
libdbpp-odbc-2a1fa15d8baa4eda37e17b2e9362f8bde17a939d.zip
libcodbcpp initial release
Diffstat (limited to 'libodbcpp/string.cpp')
-rw-r--r--libodbcpp/string.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/libodbcpp/string.cpp b/libodbcpp/string.cpp
new file mode 100644
index 0000000..d04e141
--- /dev/null
+++ b/libodbcpp/string.cpp
@@ -0,0 +1,39 @@
+#include <stdarg.h>
+#include "string.h"
+
+ODBC::String::String()
+{
+}
+ODBC::String::String(std::basic_string<unsigned char> s) :
+ std::basic_string<unsigned char>(s)
+{
+}
+ODBC::String::String(std::basic_string<char> s) :
+ std::basic_string<unsigned char>((unsigned char *)s.c_str())
+{
+}
+ODBC::String::String(const char * s) :
+ std::basic_string<unsigned char>((unsigned char *)s)
+{
+}
+ODBC::String::String(const unsigned char * s) :
+ std::basic_string<unsigned char>(s)
+{
+}
+
+ODBC::String::operator unsigned char * () const
+{
+ return (unsigned char*)c_str();
+}
+
+ODBC::String
+ODBC::String::Format(const char * fmt, ...)
+{
+ char * buf;
+ va_list va;
+ va_start(va, fmt);
+ vasprintf(&buf, fmt, va);
+ va_end(va);
+ return buf;
+}
+