diff options
author | Brian Cully <bjc@kublai.com> | 2008-04-14 21:54:00 -0400 |
---|---|---|
committer | Brian Cully <github.20.shmit@spamgourmet.com> | 2008-04-14 21:54:00 -0400 |
commit | 79d65188b1c1578a36403c0e5756c81dcc93d816 (patch) | |
tree | 2903ed400cd0ebd13350397d402c1d9d5b9f869d /libconfig/.svn/text-base/Parser.m.svn-base | |
parent | 6ba98a9f9f48e13738d9736cba9c45b5e94f42f2 (diff) | |
download | nastd-79d65188b1c1578a36403c0e5756c81dcc93d816.tar.gz nastd-79d65188b1c1578a36403c0e5756c81dcc93d816.zip |
Remove svn files
Diffstat (limited to 'libconfig/.svn/text-base/Parser.m.svn-base')
-rw-r--r-- | libconfig/.svn/text-base/Parser.m.svn-base | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/libconfig/.svn/text-base/Parser.m.svn-base b/libconfig/.svn/text-base/Parser.m.svn-base deleted file mode 100644 index f95cb3d..0000000 --- a/libconfig/.svn/text-base/Parser.m.svn-base +++ /dev/null @@ -1,95 +0,0 @@ -#include "Parser.h" -#include "ArrayData.h" -#include "DictData.h" -#include "NumData.h" -#include "StringData.h" -#include "String.h" - -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -@implementation Parser --(int) -getLineLenFrom: (const char *)startAddr to: (const char *)endAddr -{ - int len; - char quote = '\0'; - int frenchBraces = 0, squareBraces = 0; - - for (len = 0; startAddr+len < endAddr; len++) { - if (!quote && !frenchBraces && !squareBraces && - *(startAddr+len) == ';') - break; - - switch (*(startAddr+len)) { - case '{': - frenchBraces++; - break; - case '}': - if (!frenchBraces) - fprintf(stderr, - "WARNING: found `}' without `{'.\n"); - else - frenchBraces--; - break; - case '[': - squareBraces++; - break; - case ']': - if (!squareBraces) - fprintf(stderr, - "WARNING: found ']' without '['.\n"); - else - squareBraces--; - break; - case '"': - if (!quote) - quote = *(startAddr+len); - else - quote = '\0'; - break; - } - } - - return len; -} - --init -{ - return self; -} - --free -{ - return [super free]; -} - --(DataObject *) -getDataFrom: (String *)dataStr -{ - const char *dataBuff; - id dataElem; - - dataBuff = [dataStr getStr]; - - /* Figure out what type of node to allocate. */ - switch (dataBuff[0]) { - case '{': - dataElem = [[DictData new] init]; - break; - case '[': - dataElem = [[ArrayData new] init]; - break; - case '"': - dataElem = [[StringData new] init]; - break; - default: - dataElem = [[NumData new] init]; - break; - } - - return [dataElem setFromBuffer: dataBuff withLength: [dataStr getLen]]; -} -@end |