Statistics
| Branch: | Revision:

root / json-framework-3.2.0 / Classes / SBJsonTokeniser.h @ 3ebe9884

History | View | Annotate | Download (2.1 kB)

1
/*
2
 Copyright (c) 2010, Stig Brautaset.
3
 All rights reserved.
4
 
5
 Redistribution and use in source and binary forms, with or without
6
 modification, are permitted provided that the following conditions are
7
 met:
8
 
9
 Redistributions of source code must retain the above copyright
10
 notice, this list of conditions and the following disclaimer.
11
 
12
 Redistributions in binary form must reproduce the above copyright
13
 notice, this list of conditions and the following disclaimer in the
14
 documentation and/or other materials provided with the distribution.
15
 
16
 Neither the name of the the author nor the names of its contributors
17
 may be used to endorse or promote products derived from this software
18
 without specific prior written permission.
19
 
20
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21
 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22
 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23
 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
 */
32

    
33
#import <Foundation/Foundation.h>
34

    
35
typedef enum {
36
    sbjson_token_error = -1,
37
    sbjson_token_eof,
38
    
39
    sbjson_token_array_start,
40
    sbjson_token_array_end,
41
    
42
    sbjson_token_object_start,
43
    sbjson_token_object_end,
44

    
45
    sbjson_token_separator,
46
    sbjson_token_keyval_separator,
47
    
48
    sbjson_token_number,
49
    sbjson_token_string,
50
    sbjson_token_true,
51
    sbjson_token_false,
52
    sbjson_token_null,
53
    
54
} sbjson_token_t;
55

    
56
@class SBJsonUTF8Stream;
57

    
58
@interface SBJsonTokeniser : NSObject 
59

    
60
@property (strong) SBJsonUTF8Stream *stream;
61
@property (copy) NSString *error;
62

    
63
- (void)appendData:(NSData*)data_;
64

    
65
- (sbjson_token_t)getToken:(NSObject**)token;
66

    
67
@end