blob: f26a0360d987ccc63725b1115b73512fb53eb11f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
/*
* $Id: type.c,v 1.3 2004/12/12 20:26:25 lordjaxom Exp $
*/
#include "xml/type.h"
#include "xml/function.h"
#include <stdio.h>
const std::string &cxType::String(void) {
if (mType == number) {
char *buffer;
asprintf(&buffer, "%d", mNumber);
mString = buffer;
mType = string;
free(buffer);
} else if (mType == boolean) {
mString = mNumber ? cxFunction::True : cxFunction::False;
mType = string;
}
return mString;
}
|