~ubuntu-branches/ubuntu/vivid/gloox/vivid-proposed

« back to all changes in this revision

Viewing changes to src/parser.cpp

  • Committer: Package Import Robot
  • Author(s): Vincent Cheng
  • Date: 2014-03-16 17:34:43 UTC
  • mfrom: (12.1.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: package-import@ubuntu.com-20140316173443-4s177dovzaz5dm8o
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
  Copyright (c) 2004-2009 by Jakob Schroeter <js@camaya.net>
 
2
  Copyright (c) 2004-2013 by Jakob Schroeter <js@camaya.net>
3
3
  This file is part of the gloox library. http://camaya.net/gloox
4
4
 
5
5
  This software is distributed under a license. The full license
123
123
 
124
124
    switch( m_state )
125
125
    {
 
126
      case InterTag:
126
127
      case TagInside:
127
128
        m_cdata += rep;
128
129
        break;
200
201
//           printf( "InterTag: %c\n", c );
201
202
          m_tag = EmptyString;
202
203
          if( isWhitespace( c ) )
 
204
          {
 
205
            m_state = TagInside;
 
206
            if( m_current )
 
207
              m_cdata += c;
203
208
            break;
 
209
          }
204
210
 
205
211
          switch( c )
206
212
          {
 
213
            case '&':
 
214
//               printf( "InterTag, calling decode\n" );
 
215
              switch( decode( i, data ) )
 
216
              {
 
217
                case DecodeValid:
 
218
                  m_state = TagInside;
 
219
                  break;
 
220
                case DecodeInvalid:
 
221
                  cleanup();
 
222
                  return static_cast<int>( i );
 
223
                case DecodeInsufficient:
 
224
                  return -1;
 
225
              }
 
226
              break;
207
227
            case '<':
208
228
              m_state = TagOpening;
209
229
              break;