summaryrefslogtreecommitdiff
path: root/xml/type.c
diff options
context:
space:
mode:
Diffstat (limited to 'xml/type.c')
-rw-r--r--xml/type.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/xml/type.c b/xml/type.c
new file mode 100644
index 0000000..d311b30
--- /dev/null
+++ b/xml/type.c
@@ -0,0 +1,20 @@
+/*
+ * $Id: type.c,v 1.2 2004/12/08 17:13:26 lordjaxom Exp $
+ */
+
+#include "xml/type.h"
+#include "xml/function.h"
+#include <stdio.h>
+
+const std::string &cxType::String(void) {
+ static char buffer[50];
+ if (mType == number) {
+ snprintf(buffer, sizeof(buffer), "%d", mNumber);
+ mString = buffer;
+ mType = string;
+ } else if (mType == boolean) {
+ mString = mNumber ? cxFunction::True : cxFunction::False;
+ mType = string;
+ }
+ return mString;
+}