-
Notifications
You must be signed in to change notification settings - Fork 2
/
NSString+DictLineParsing.h
37 lines (31 loc) · 1.04 KB
/
NSString+DictLineParsing.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* -*-objc-*-
*
* Dictionary Reader - A Dict client for GNUstep
* Copyright (C) 2006 Guenther Noack
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING.
*/
#import <Foundation/Foundation.h>
@interface NSString (DictLineParsing)
/**
* Splits a Dict-protocol-style string into its components and returns
* an array with those components. A string like this consists of one
* or more strings that are separated by a whitespace. A string that
* contains whitespaces itself can be put into quotation marks.
*
* Example:
* The string
* '151 "Awful" gcide "The Collaborative International Dict..."'
*
* would decode to:
* ['151', 'Awful', 'gcide', 'The Collaborative Internation...']
*/
-(NSArray*) parseDictLine;
/**
* Splits the string into its dict-style components (see documentation
* for @see(parseDictLine) for more information) and returns the
* component with the index given in the index argument.
*/
-(NSString*) dictLineComponent: (int)index;
@end