Permalink
Browse files

consolidated directories.

  • Loading branch information...
1 parent 2ae7e22 commit ca9a6fcfb4f85401d1a7a4eae38a7d55123e692d @psychs committed Jul 25, 2008
Showing with 3 additions and 72,691 deletions.
  1. +0 −63 core/OnigRegexp.h
  2. +0 −292 core/OnigRegexp.m
  3. +0 −29 core/OnigRegexpUtility.h
  4. +0 −80 core/OnigRegexpUtility.m
  5. +0 −28 core/oniguruma/COPYING
  6. +0 −112 core/oniguruma/config.h
  7. +0 −58 core/oniguruma/enc/ascii.c
  8. +0 −11,356 core/oniguruma/enc/unicode.c
  9. +0 −229 core/oniguruma/enc/utf16_le.c
  10. +0 −765 core/oniguruma/oniguruma.h
  11. +0 −6,311 core/oniguruma/regcomp.c
  12. +0 −902 core/oniguruma/regenc.c
  13. +0 −186 core/oniguruma/regenc.h
  14. +0 −387 core/oniguruma/regerror.c
  15. +0 −3,805 core/oniguruma/regexec.c
  16. +0 −166 core/oniguruma/regext.c
  17. +0 −809 core/oniguruma/regint.h
  18. +0 −5,534 core/oniguruma/regparse.c
  19. +0 −351 core/oniguruma/regparse.h
  20. +0 −315 core/oniguruma/regsyntax.c
  21. +0 −76 core/oniguruma/regtrav.c
  22. +0 −56 core/oniguruma/regversion.c
  23. +0 −578 core/oniguruma/st.c
  24. +0 −63 core/oniguruma/st.h
  25. +0 −67 core/readme.txt
  26. +2 −18 framework/CocoaOniguruma.xcodeproj/project.pbxproj
  27. BIN framework/English.lproj/InfoPlist.strings
  28. +1 −1 framework/Info.plist
  29. +0 −67 framework/core/readme.txt
  30. +0 −7 samples/core-sample/AppController.h
  31. +0 −95 samples/core-sample/AppController.m
  32. +0 −63 samples/core-sample/CocoaOniguruma/OnigRegexp.h
  33. +0 −292 samples/core-sample/CocoaOniguruma/OnigRegexp.m
  34. +0 −29 samples/core-sample/CocoaOniguruma/OnigRegexpUtility.h
  35. +0 −80 samples/core-sample/CocoaOniguruma/OnigRegexpUtility.m
  36. +0 −28 samples/core-sample/CocoaOniguruma/oniguruma/COPYING
  37. +0 −112 samples/core-sample/CocoaOniguruma/oniguruma/config.h
  38. +0 −58 samples/core-sample/CocoaOniguruma/oniguruma/enc/ascii.c
  39. +0 −11,356 samples/core-sample/CocoaOniguruma/oniguruma/enc/unicode.c
  40. +0 −229 samples/core-sample/CocoaOniguruma/oniguruma/enc/utf16_le.c
  41. +0 −765 samples/core-sample/CocoaOniguruma/oniguruma/oniguruma.h
  42. +0 −6,311 samples/core-sample/CocoaOniguruma/oniguruma/regcomp.c
  43. +0 −902 samples/core-sample/CocoaOniguruma/oniguruma/regenc.c
  44. +0 −186 samples/core-sample/CocoaOniguruma/oniguruma/regenc.h
  45. +0 −387 samples/core-sample/CocoaOniguruma/oniguruma/regerror.c
  46. +0 −3,805 samples/core-sample/CocoaOniguruma/oniguruma/regexec.c
  47. +0 −166 samples/core-sample/CocoaOniguruma/oniguruma/regext.c
  48. +0 −809 samples/core-sample/CocoaOniguruma/oniguruma/regint.h
  49. +0 −5,534 samples/core-sample/CocoaOniguruma/oniguruma/regparse.c
  50. +0 −351 samples/core-sample/CocoaOniguruma/oniguruma/regparse.h
  51. +0 −315 samples/core-sample/CocoaOniguruma/oniguruma/regsyntax.c
  52. +0 −76 samples/core-sample/CocoaOniguruma/oniguruma/regtrav.c
  53. +0 −56 samples/core-sample/CocoaOniguruma/oniguruma/regversion.c
  54. +0 −578 samples/core-sample/CocoaOniguruma/oniguruma/st.c
  55. +0 −63 samples/core-sample/CocoaOniguruma/oniguruma/st.h
  56. +0 −67 samples/core-sample/CocoaOniguruma/readme.txt
  57. BIN samples/core-sample/English.lproj/InfoPlist.strings
  58. +0 −2,744 samples/core-sample/English.lproj/MainMenu.nib/designable.nib
  59. BIN samples/core-sample/English.lproj/MainMenu.nib/keyedobjects.nib
  60. +0 −28 samples/core-sample/Info.plist
  61. +0 −391 samples/core-sample/RegexpTest.xcodeproj/project.pbxproj
  62. +0 −7 samples/core-sample/RegexpTest_Prefix.pch
  63. +0 −6 samples/core-sample/main.m
  64. +0 −7 samples/framework-sample/AppController.h
  65. +0 −95 samples/framework-sample/AppController.m
  66. BIN samples/framework-sample/English.lproj/InfoPlist.strings
  67. +0 −2,744 samples/framework-sample/English.lproj/MainMenu.nib/designable.nib
  68. BIN samples/framework-sample/English.lproj/MainMenu.nib/keyedobjects.nib
  69. +0 −1 samples/framework-sample/Frameworks/CocoaOniguruma.framework/CocoaOniguruma
  70. +0 −1 samples/framework-sample/Frameworks/CocoaOniguruma.framework/Headers
  71. +0 −1 samples/framework-sample/Frameworks/CocoaOniguruma.framework/Resources
  72. BIN samples/framework-sample/Frameworks/CocoaOniguruma.framework/Versions/A/CocoaOniguruma
  73. +0 −63 samples/framework-sample/Frameworks/CocoaOniguruma.framework/Versions/A/Headers/OnigRegexp.h
  74. +0 −29 samples/framework-sample/Frameworks/CocoaOniguruma.framework/Versions/A/Headers/OnigRegexpUtility.h
  75. +0 −765 samples/framework-sample/Frameworks/CocoaOniguruma.framework/Versions/A/Headers/oniguruma.h
  76. BIN ...k-sample/Frameworks/CocoaOniguruma.framework/Versions/A/Resources/English.lproj/InfoPlist.strings
  77. +0 −22 samples/framework-sample/Frameworks/CocoaOniguruma.framework/Versions/A/Resources/Info.plist
  78. +0 −1 samples/framework-sample/Frameworks/CocoaOniguruma.framework/Versions/Current
  79. +0 −28 samples/framework-sample/Info.plist
  80. +0 −321 samples/framework-sample/RegexpTest.xcodeproj/project.pbxproj
  81. +0 −7 samples/framework-sample/RegexpTest_Prefix.pch
  82. +0 −6 samples/framework-sample/main.m
View
@@ -1,63 +0,0 @@
-// Created by Satoshi Nakagawa.
-// You can redistribute it and/or modify it under the revised BSD license.
-
-#import <Foundation/Foundation.h>
-#import "oniguruma.h"
-#import "OnigRegexpUtility.h"
-
-@class OnigResult;
-
-
-@interface OnigRegexp : NSObject
-{
- regex_t* _entity;
- NSString* _expression;
-}
-
-+ (OnigRegexp*)compile:(NSString*)expression;
-+ (OnigRegexp*)compileIgnorecase:(NSString*)expression;
-+ (OnigRegexp*)compile:(NSString*)expression ignorecase:(BOOL)ignorecase multiline:(BOOL)multiline;
-+ (OnigRegexp*)compile:(NSString*)expression ignorecase:(BOOL)ignorecase multiline:(BOOL)multiline extended:(BOOL)extended;
-
-- (OnigResult*)search:(NSString*)target;
-- (OnigResult*)search:(NSString*)target start:(int)start;
-- (OnigResult*)search:(NSString*)target start:(int)start end:(int)end;
-- (OnigResult*)search:(NSString*)target range:(NSRange)range;
-
-- (OnigResult*)match:(NSString*)target;
-- (OnigResult*)match:(NSString*)target start:(int)start;
-
-- (NSString*)expression;
-
-@end
-
-
-@interface OnigResult : NSObject
-{
- OnigRegexp* _expression;
- OnigRegion* _region;
- NSString* _target;
-}
-
-- (NSString*)target;
-
-- (int)count;
-- (NSString*)stringAt:(int)index;
-- (NSArray*)strings;
-- (NSRange)rangeAt:(int)index;
-- (int)locationAt:(int)index;
-- (int)lengthAt:(int)index;
-
-- (NSString*)body;
-- (NSRange)bodyRange;
-
-- (NSString*)preMatch;
-- (NSString*)postMatch;
-
-// named capture support
-- (int)indexForName:(NSString*)name;
-- (NSIndexSet*)indexesForName:(NSString*)name;
-- (NSString*)stringForName:(NSString*)name;
-- (NSArray*)stringsForName:(NSString*)name;
-
-@end
View
@@ -1,292 +0,0 @@
-// Created by Satoshi Nakagawa.
-// You can redistribute it and/or modify it under the revised BSD license.
-
-#import "OnigRegexp.h"
-
-#define CHAR_SIZE 2
-
-#ifndef NSUTF16LittleEndianStringEncoding
-#define NSUTF16LittleEndianStringEncoding (-1811939072)
-#endif
-
-#define STRING_ENCODING NSUTF16LittleEndianStringEncoding
-#define ONIG_ENCODING ONIG_ENCODING_UTF16_LE
-
-
-@interface OnigResult (Private)
-- (id)initWithRegexp:(OnigRegexp*)expression region:(OnigRegion*)region target:(NSString*)target;
-@end
-
-
-@implementation OnigRegexp
-
-- (id)initWithEntity:(regex_t*)entity expression:(NSString*)expression
-{
- self = [super init];
- if (self) {
- _entity = entity;
- _expression = [expression copy];
- }
- return self;
-}
-
-- (void)dealloc
-{
- if (_entity) onig_free(_entity);
- [_expression release];
- [super dealloc];
-}
-
-+ (OnigRegexp*)compile:(NSString*)expression
-{
- return [self compile:expression ignorecase:NO multiline:NO extended:NO];
-}
-
-+ (OnigRegexp*)compileIgnorecase:(NSString*)expression
-{
- return [self compile:expression ignorecase:YES multiline:NO extended:NO];
-}
-
-+ (OnigRegexp*)compile:(NSString*)expression ignorecase:(BOOL)ignorecase multiline:(BOOL)multiline
-{
- return [self compile:expression ignorecase:ignorecase multiline:multiline extended:NO];
-}
-
-+ (OnigRegexp*)compile:(NSString*)expression ignorecase:(BOOL)ignorecase multiline:(BOOL)multiline extended:(BOOL)extended
-{
- if (!expression) return nil;
-
- OnigOptionType option = ONIG_OPTION_NONE;
- option |= multiline ? ONIG_OPTION_MULTILINE : ONIG_OPTION_SINGLELINE;
- if (ignorecase) option |= ONIG_OPTION_IGNORECASE;
- if (extended) option |= ONIG_OPTION_EXTEND;
-
- OnigErrorInfo err;
- regex_t* entity = 0;
- const UChar* str = (const UChar*)[expression cStringUsingEncoding:STRING_ENCODING];
-
- int status = onig_new(&entity,
- str,
- str + [expression length] * CHAR_SIZE,
- option,
- ONIG_ENCODING,
- ONIG_SYNTAX_DEFAULT,
- &err);
-
- if (status == ONIG_NORMAL) {
- return [[[self alloc] initWithEntity:entity expression:expression] autorelease];
- } else {
- if (entity) onig_free(entity);
- return nil;
- }
-}
-
-- (OnigResult*)search:(NSString*)target
-{
- return [self search:target start:0 end:-1];
-}
-
-- (OnigResult*)search:(NSString*)target start:(int)start
-{
- return [self search:target start:start end:-1];
-}
-
-- (OnigResult*)search:(NSString*)target start:(int)start end:(int)end
-{
- if (!target) return nil;
- if (end < 0) end = [target length];
-
- OnigRegion* region = onig_region_new();
- const UChar* str = (const UChar*)[target cStringUsingEncoding:STRING_ENCODING];
-
- int status = onig_search(_entity,
- str,
- str + [target length] * CHAR_SIZE,
- str + start * CHAR_SIZE,
- str + end * CHAR_SIZE,
- region,
- ONIG_OPTION_NONE);
-
- if (status != ONIG_MISMATCH) {
- return [[[OnigResult alloc] initWithRegexp:self region:region target:target] autorelease];
- } else {
- onig_region_free(region, 1);
- return nil;
- }
-}
-
-- (OnigResult*)search:(NSString*)target range:(NSRange)range
-{
- return [self search:target start:range.location end:NSMaxRange(range)];
-}
-
-- (OnigResult*)match:(NSString*)target
-{
- return [self match:target start:0];
-}
-
-- (OnigResult*)match:(NSString*)target start:(int)start
-{
- if (!target) return nil;
-
- OnigRegion* region = onig_region_new();
- const UChar* str = (const UChar*)[target cStringUsingEncoding:STRING_ENCODING];
-
- int status = onig_match(_entity,
- str,
- str + [target length] * CHAR_SIZE,
- str + start * CHAR_SIZE,
- region,
- ONIG_OPTION_NONE);
-
- if (status != ONIG_MISMATCH) {
- return [[[OnigResult alloc] initWithRegexp:self region:region target:target] autorelease];
- } else {
- onig_region_free(region, 1);
- return nil;
- }
-}
-
-- (NSString*)expression
-{
- return _expression;
-}
-
-- (regex_t*)entity
-{
- return _entity;
-}
-
-@end
-
-
-@implementation OnigResult
-
-- (id)initWithRegexp:(OnigRegexp*)expression region:(OnigRegion*)region target:(NSString*)target
-{
- self = [super init];
- if (self) {
- _expression = [expression retain];
- _region = region;
- _target = [target copy];
- }
- return self;
-}
-
-- (void)dealloc
-{
- [_expression release];
- if (_region) onig_region_free(_region, 1);
- [_target release];
- [super dealloc];
-}
-
-- (NSString*)target
-{
- return _target;
-}
-
-- (int)size
-{
- return [self count];
-}
-
-- (int)count
-{
- return _region->num_regs;
-}
-
-- (NSString*)stringAt:(int)index
-{
- return [_target substringWithRange:[self rangeAt:index]];
-}
-
-- (NSArray*)strings
-{
- NSMutableArray* array = [NSMutableArray array];
- int i, count;
- for (i=0, count=[self count]; i<count; i++) {
- [array addObject:[self stringAt:i]];
- }
- return array;
-}
-
-- (NSRange)rangeAt:(int)index
-{
- return NSMakeRange([self locationAt:index], [self lengthAt:index]);
-}
-
-- (int)locationAt:(int)index
-{
- return *(_region->beg + index) / CHAR_SIZE;
-}
-
-- (int)lengthAt:(int)index
-{
- return (*(_region->end + index) - *(_region->beg + index)) / CHAR_SIZE;
-}
-
-- (NSString*)body
-{
- return [self stringAt:0];
-}
-
-- (NSRange)bodyRange
-{
- return [self rangeAt:0];
-}
-
-- (NSString*)preMatch
-{
- return [_target substringToIndex:[self locationAt:0]];
-}
-
-- (NSString*)postMatch
-{
- return [_target substringFromIndex:[self locationAt:0] + [self lengthAt:0]];
-}
-
-- (int)indexForName:(NSString*)name
-{
- NSIndexSet* indexes = [self indexesForName:name];
- return indexes ? [indexes firstIndex] : -1;
-}
-
-- (NSIndexSet*)indexesForName:(NSString*)name
-{
- int len = sizeof(int) * [self count];
- int* buf = alloca(len);
- memset(&buf, 0, len);
- const UChar* str = (const UChar*)[name cStringUsingEncoding:STRING_ENCODING];
-
- int num = onig_name_to_group_numbers([_expression entity], str, str + [name length] * CHAR_SIZE, &buf);
- if (num < 0) return nil;
-
- NSMutableIndexSet* indexes = [NSMutableIndexSet indexSet];
- int i;
- for (i=0; i<num; i++) {
- [indexes addIndex:*(buf+i)];
- }
- return indexes;
-}
-
-- (NSString*)stringForName:(NSString*)name
-{
- int n = [self indexForName:name];
- return n < 0 ? nil : [self stringAt:n];
-}
-
-- (NSArray*)stringsForName:(NSString*)name
-{
- NSIndexSet* indexes = [self indexesForName:name];
- if (!indexes) return nil;
-
- NSMutableArray* array = [NSMutableArray array];
- int i;
- for (i=[indexes firstIndex]; i!=NSNotFound; i=[indexes indexGreaterThanIndex:i]) {
- [array addObject:[self stringAt:i]];
- }
- return array;
-}
-
-@end
View
@@ -1,29 +0,0 @@
-// Created by Satoshi Nakagawa.
-// You can redistribute it and/or modify it under the revised BSD license.
-
-#import <Foundation/Foundation.h>
-#import "oniguruma.h"
-#import "OnigRegexp.h"
-
-@class OnigRegexp;
-@class OnigResult;
-
-
-@interface NSString (OnigRegexpUtility)
-
-// expression is OnigRegexp or NSString
-
-- (NSRange)rangeOfRegexp:(id)expression;
-- (NSArray*)splitByRegexp:(id)expression;
-
-@end
-
-
-@interface NSMutableString (OnigRegexpUtility)
-
-// expression is OnigRegexp or NSString
-
-- (BOOL)replaceByRegexp:(id)expression with:(NSString*)string;
-- (int)replaceAllByRegexp:(id)expression with:(NSString*)string;
-
-@end
Oops, something went wrong.

0 comments on commit ca9a6fc

Please sign in to comment.