s/TCHAR/char/
This commit is contained in:
+13
-13
@@ -9,11 +9,11 @@
|
|||||||
#include "DateTime.h"
|
#include "DateTime.h"
|
||||||
|
|
||||||
|
|
||||||
static const TCHAR chXMLTagOpen = '<';
|
static const char chXMLTagOpen = '<';
|
||||||
static const TCHAR chXMLTagClose = '>';
|
static const char chXMLTagClose = '>';
|
||||||
static const TCHAR chXMLTagQuestion = '?'; // used in checking for meta tags: "<?TAG ... ?/>"
|
static const char chXMLTagQuestion = '?'; // used in checking for meta tags: "<?TAG ... ?/>"
|
||||||
static const TCHAR chXMLTagPre = '/';
|
static const char chXMLTagPre = '/';
|
||||||
static const TCHAR chXMLEscape = '\\'; // for value field escape
|
static const char chXMLEscape = '\\'; // for value field escape
|
||||||
|
|
||||||
|
|
||||||
static const XENTITY x_EntityTable[] = {
|
static const XENTITY x_EntityTable[] = {
|
||||||
@@ -205,7 +205,7 @@ char* XNode::LoadAttributes( const char* pszAttrs , PARSEINFO *pi /*= &piDefault
|
|||||||
return xml;
|
return xml;
|
||||||
|
|
||||||
// XML Attr Name
|
// XML Attr Name
|
||||||
TCHAR* pEnd = strpbrk( xml, " =" );
|
char* pEnd = strpbrk( xml, " =" );
|
||||||
if( pEnd == NULL )
|
if( pEnd == NULL )
|
||||||
{
|
{
|
||||||
// error
|
// error
|
||||||
@@ -254,7 +254,7 @@ char* XNode::LoadAttributes( const char* pszAttrs , PARSEINFO *pi /*= &piDefault
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool trim = pi->trim_value;
|
bool trim = pi->trim_value;
|
||||||
TCHAR escape = pi->escape_value;
|
char escape = pi->escape_value;
|
||||||
//SetString( xml, pEnd, &attr->value, trim, chXMLEscape );
|
//SetString( xml, pEnd, &attr->value, trim, chXMLEscape );
|
||||||
SetString( xml, pEnd, &attr->value, trim, escape );
|
SetString( xml, pEnd, &attr->value, trim, escape );
|
||||||
xml = pEnd;
|
xml = pEnd;
|
||||||
@@ -303,7 +303,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
|
|||||||
|
|
||||||
// XML Node Tag Name Open
|
// XML Node Tag Name Open
|
||||||
xml++;
|
xml++;
|
||||||
TCHAR* pTagEnd = strpbrk( xml, " />" );
|
char* pTagEnd = strpbrk( xml, " />" );
|
||||||
SetString( xml, pTagEnd, &name );
|
SetString( xml, pTagEnd, &name );
|
||||||
xml = pTagEnd;
|
xml = pTagEnd;
|
||||||
// Generate XML Attributte List
|
// Generate XML Attributte List
|
||||||
@@ -351,7 +351,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
|
|||||||
if( XIsEmptyString( value ) )
|
if( XIsEmptyString( value ) )
|
||||||
{
|
{
|
||||||
// Text Value
|
// Text Value
|
||||||
TCHAR* pEnd = tcsechr( ++xml, chXMLTagOpen, chXMLEscape );
|
char* pEnd = tcsechr( ++xml, chXMLTagOpen, chXMLEscape );
|
||||||
if( pEnd == NULL )
|
if( pEnd == NULL )
|
||||||
{
|
{
|
||||||
if( pi->erorr_occur == false )
|
if( pi->erorr_occur == false )
|
||||||
@@ -366,7 +366,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool trim = pi->trim_value;
|
bool trim = pi->trim_value;
|
||||||
TCHAR escape = pi->escape_value;
|
char escape = pi->escape_value;
|
||||||
//SetString( xml, pEnd, &value, trim, chXMLEscape );
|
//SetString( xml, pEnd, &value, trim, chXMLEscape );
|
||||||
SetString( xml, pEnd, &value, trim, escape );
|
SetString( xml, pEnd, &value, trim, escape );
|
||||||
|
|
||||||
@@ -405,7 +405,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
CString closename;
|
CString closename;
|
||||||
TCHAR* pEnd = strpbrk( xml, " >" );
|
char* pEnd = strpbrk( xml, " >" );
|
||||||
if( pEnd == NULL )
|
if( pEnd == NULL )
|
||||||
{
|
{
|
||||||
if( pi->erorr_occur == false )
|
if( pi->erorr_occur == false )
|
||||||
@@ -449,7 +449,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
|
|||||||
if( xml && XIsEmptyString( value ) && *xml !=chXMLTagOpen )
|
if( xml && XIsEmptyString( value ) && *xml !=chXMLTagOpen )
|
||||||
{
|
{
|
||||||
// Text Value
|
// Text Value
|
||||||
TCHAR* pEnd = tcsechr( xml, chXMLTagOpen, chXMLEscape );
|
char* pEnd = tcsechr( xml, chXMLTagOpen, chXMLEscape );
|
||||||
if( pEnd == NULL )
|
if( pEnd == NULL )
|
||||||
{
|
{
|
||||||
// error cos not exist CloseTag </TAG>
|
// error cos not exist CloseTag </TAG>
|
||||||
@@ -464,7 +464,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool trim = pi->trim_value;
|
bool trim = pi->trim_value;
|
||||||
TCHAR escape = pi->escape_value;
|
char escape = pi->escape_value;
|
||||||
//SetString( xml, pEnd, &value, trim, chXMLEscape );
|
//SetString( xml, pEnd, &value, trim, chXMLEscape );
|
||||||
SetString( xml, pEnd, &value, trim, escape );
|
SetString( xml, pEnd, &value, trim, escape );
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ typedef std::vector<XNode*> XNodes;
|
|||||||
// Entity Encode/Decode Support
|
// Entity Encode/Decode Support
|
||||||
struct XENTITY
|
struct XENTITY
|
||||||
{
|
{
|
||||||
TCHAR entity; // entity ( & " ' < > )
|
char entity; // entity ( & " ' < > )
|
||||||
TCHAR ref[10]; // entity reference ( & " etc )
|
char ref[10]; // entity reference ( & " etc )
|
||||||
int ref_len; // entity reference length
|
int ref_len; // entity reference length
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ struct PARSEINFO
|
|||||||
bool trim_value; // [set] do trim when parse?
|
bool trim_value; // [set] do trim when parse?
|
||||||
bool entity_value; // [set] do convert from reference to entity? ( < -> < )
|
bool entity_value; // [set] do convert from reference to entity? ( < -> < )
|
||||||
XENTITYS *entitys; // [set] entity table for entity decode
|
XENTITYS *entitys; // [set] entity table for entity decode
|
||||||
TCHAR escape_value; // [set] escape value (default '\\')
|
char escape_value; // [set] escape value (default '\\')
|
||||||
|
|
||||||
char* xml; // [get] xml source
|
char* xml; // [get] xml source
|
||||||
bool erorr_occur; // [get] is occurance of error?
|
bool erorr_occur; // [get] is occurance of error?
|
||||||
|
|||||||
Reference in New Issue
Block a user