27 #ifndef _SAXPARSER_HPP_ 
   28 #define _SAXPARSER_HPP_ 
   33 #include "boost/iostreams/positioning.hpp" 
   82         memcpy(
data(),rhs.c_str(),rhs.length());
 
   83         (*this)[rhs.length()] = 0; 
 
   87         if (strchr(
c_str(),
'&')) {
 
  106         init(rhs ? strlen(rhs) : 0);
 
  115             size_t oldsize = 
length();
 
  123         size_t rhslen = rhs?strlen(rhs):0;
 
  125             size_t oldsize = 
length();
 
  127             strcpy(
data()+oldsize,rhs);
 
  133         return c && !strcmp(c,
c_str());
 
  137         return !strcmp(
c_str(),s.c_str());
 
  148         size_t new_used = size + 
_lead; 
 
  152                 throw std::runtime_error(
"SAXParser: cannot allocate memory");
 
  183         for (
const char *c=
c_str(); *c && strchr(
" \n\r\t",*c); c++) {
 
  190         return !strncmp(
c_str(),txt,strlen(txt));
 
  193         size_t len = strlen(txt);
 
  227 template< 
typename Target > 
inline Target 
textToValue(
const char *txt); 
 
  231     return (
float) 
ATOF( txt ) ;
 
  234 template<> 
inline double textToValue(
const char *txt)
 
  244 template<> 
inline char textToValue(
const char *txt)
 
  249 template<> 
inline long textToValue(
const char *txt)
 
  254 template<> 
inline unsigned int textToValue(
const char *txt)
 
  256     return (
unsigned int) strtoul( txt, NULL, 10 );
 
  259 template<> 
inline unsigned long textToValue(
const char *txt)
 
  261     return strtoul( txt, NULL, 10 );
 
  264 #if defined(BOOST_HAS_LONG_LONG) 
  266 template<> 
inline long long textToValue(
const char *txt)
 
  268 #if defined(BOOST_HAS_MS_INT64) 
  275 template<> 
inline unsigned long long textToValue(
const char *txt)
 
  277 #if defined(BOOST_HAS_MS_INT64) 
  278     return  _strtoui64(txt,NULL,10);
 
  280     return strtoull( txt, NULL, 10 );
 
  284 #endif // has long long 
  288     return strcmp(t, 
"0") && strcmp(t,
"false"); 
 
  291 template<> 
inline bool textToValue(
const char *txt)
 
  296 template<> 
inline boost::logic::tribool 
textToValue(
const char *txt)
 
  298     using namespace boost::logic;
 
  300         return tribool(indeterminate);
 
  308 template<> 
inline std::string 
textToValue(
const char *txt)
 
  310     return std::string( txt );
 
  357         Attributes(
const char * _source_text, 
size_t _source_text_len, 
bool _autoUnescape) :
 
  360               size=_source_text_len;
 
  409             for (
size_t n=
attrs.size();n--;) 
 
  421             for (
size_t n=
attrs.size();n--;) 
 
  459             while (*c && !strchr(
" \n\r\t/",*c)) c++;
 
  461             while (*c && strchr(
" \n\r\t",*c)) c++;
 
  462             textbuff[indexNameEnd] = 0; 
 
  475                 return !strcmp(test,
name); 
 
  498             template< 
typename T >
 
  506                 return (
size_t)strtoul(
getValuePtr(Unescape),NULL,10);
 
  514             void set(
const char *_name, 
char *_value, 
bool _needsUnescape) 
 
  527             attribute_list::const_iterator 
begin()
 const  
  530                     return attrs.begin();
 
  532             attribute_list::const_iterator 
end()
 const  
  537             attribute_list::const_iterator 
find(
const std::string &name)
 const  
  539                 attribute_list::const_iterator it;
 
  540                 for (it = 
begin(); it != 
end() ; it++ ) 
 
  542                     if (it->matchName(name.c_str())) 
 
  565                 for (attribute_list::const_iterator it=
attrs.begin();it!=
attrs.end();it++) 
 
  567                     if (it->matchName(name)) 
 
  586                                          const std::string& data,
 
  604     template <
typename T>
 
  613             result = attr->
valueAs<T>(Unescape);
 
  632     template <
typename T>
 
  647         std::string& result)
 const 
  658     template <
typename T>
 
  660         const std::string &name,
 
  728 #endif // _SAXPARSER_HPP_