Skip to content
This repository
Browse code

moved convenience methods from category in OTRestFramework to Element…

…Parser
  • Loading branch information...
commit 1ed46e17a6023cc74dfdc266af97d0126ddb4c89 1 parent fa8d284
Jeremy Ellison authored
16 .gitignore
... ... @@ -0,0 +1,16 @@
  1 +# the build
  2 +build
  3 +
  4 +# temp nibs and swap files
  5 +*~.nib
  6 +*.swp
  7 +
  8 +# OS X folder attributes
  9 +.DS_Store
  10 +
  11 +# user-specific XCode stuff
  12 +*.mode1v3
  13 +*.mode2v3
  14 +*.pbxuser
  15 +*.perspectivev3
  16 +
9 Classes/Element.h
@@ -144,6 +144,15 @@
144 144 */
145 145 -(BOOL)isEqualToString:(NSString*)string;
146 146
  147 +/**
  148 + * Convenience methods for getting NSObjects from elements and their children
  149 + */
  150 +- (NSString*)contentsTextOfChildElement:(NSString*)selector;
  151 +
  152 +- (NSNumber*)contentsNumber;
  153 +
  154 +- (NSNumber*)contentsNumberOfChildElement:(NSString*)selector;
  155 +
147 156
148 157 /**
149 158 * An array of child Elements in document order
12 Classes/Element.m
@@ -159,6 +159,18 @@ -(NSString*)contentsText{
159 159 return contentsText;
160 160 }
161 161
  162 +- (NSString*)contentsTextOfChildElement:(NSString*)selector {
  163 + return [[self selectElement:selector] contentsText];
  164 +}
  165 +
  166 +- (NSNumber*)contentsNumber {
  167 + return [NSNumber numberWithInt:[[self contentsText] intValue]];
  168 +}
  169 +
  170 +- (NSNumber*)contentsNumberOfChildElement:(NSString*)selector {
  171 + return [[self selectElement:selector] contentsNumber];
  172 +}
  173 +
162 174 -(NSString*)contentsSource{
163 175 NSRange contentsRange = NSMakeRange(NSMaxRange(range), contentsLength);
164 176 NSString* result = [source substringWithRange: contentsRange];
110 ElementParser.xcodeproj/jeremy.mode1v3
@@ -229,8 +229,6 @@
229 229 <key>Layout</key>
230 230 <array>
231 231 <dict>
232   - <key>BecomeActive</key>
233   - <true/>
234 232 <key>ContentConfiguration</key>
235 233 <dict>
236 234 <key>PBXBottomSmartGroupGIDs</key>
@@ -267,6 +265,7 @@
267 265 <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
268 266 <array>
269 267 <string>0867D691FE84028FC02AAC07</string>
  268 + <string>3F4E1923102DD47000320118</string>
270 269 <string>08FB77AEFE84172EC02AAC07</string>
271 270 <string>034768DFFF38A50411DB9C8B</string>
272 271 <string>1C37FABC05509CD000000102</string>
@@ -274,13 +273,11 @@
274 273 <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
275 274 <array>
276 275 <array>
277   - <integer>39</integer>
278   - <integer>38</integer>
279 276 <integer>0</integer>
280 277 </array>
281 278 </array>
282 279 <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
283   - <string>{{0, 226}, {186, 538}}</string>
  280 + <string>{{0, 0}, {186, 538}}</string>
284 281 </dict>
285 282 <key>PBXTopSmartGroupGIDs</key>
286 283 <array/>
@@ -299,7 +296,7 @@
299 296 <real>186</real>
300 297 </array>
301 298 <key>RubberWindowFrame</key>
302   - <string>6 129 977 597 0 0 1440 878 </string>
  299 + <string>370 111 977 597 0 0 1440 878 </string>
303 300 </dict>
304 301 <key>Module</key>
305 302 <string>PBXSmartGroupTreeModule</string>
@@ -310,12 +307,14 @@
310 307 <key>Dock</key>
311 308 <array>
312 309 <dict>
  310 + <key>BecomeActive</key>
  311 + <true/>
313 312 <key>ContentConfiguration</key>
314 313 <dict>
315 314 <key>PBXProjectModuleGUID</key>
316 315 <string>1CE0B20306471E060097A5F4</string>
317 316 <key>PBXProjectModuleLabel</key>
318   - <string>ElementParser.h</string>
  317 + <string>Element.m</string>
319 318 <key>PBXSplitModuleInNavigatorKey</key>
320 319 <dict>
321 320 <key>Split0</key>
@@ -323,22 +322,14 @@
323 322 <key>PBXProjectModuleGUID</key>
324 323 <string>1CE0B20406471E060097A5F4</string>
325 324 <key>PBXProjectModuleLabel</key>
326   - <string>ElementParser.h</string>
  325 + <string>Element.m</string>
327 326 <key>_historyCapacity</key>
328 327 <integer>0</integer>
329 328 <key>bookmark</key>
330   - <string>3F4E1913102DD40B00320118</string>
  329 + <string>3F4B66C2102E5449007EF718</string>
331 330 <key>history</key>
332 331 <array>
333   - <string>3F4E190D102DD40B00320118</string>
334   - <string>3F4E190E102DD40B00320118</string>
335   - <string>3F4E190F102DD40B00320118</string>
336   - </array>
337   - <key>prevStack</key>
338   - <array>
339   - <string>3F4E1910102DD40B00320118</string>
340   - <string>3F4E1911102DD40B00320118</string>
341   - <string>3F4E1912102DD40B00320118</string>
  332 + <string>3F4B66BB102E542C007EF718</string>
342 333 </array>
343 334 </dict>
344 335 <key>SplitCount</key>
@@ -352,7 +343,7 @@
352 343 <key>Frame</key>
353 344 <string>{{0, 0}, {769, 378}}</string>
354 345 <key>RubberWindowFrame</key>
355   - <string>6 129 977 597 0 0 1440 878 </string>
  346 + <string>370 111 977 597 0 0 1440 878 </string>
356 347 </dict>
357 348 <key>Module</key>
358 349 <string>PBXNavigatorGroup</string>
@@ -372,7 +363,7 @@
372 363 <key>Frame</key>
373 364 <string>{{0, 383}, {769, 173}}</string>
374 365 <key>RubberWindowFrame</key>
375   - <string>6 129 977 597 0 0 1440 878 </string>
  366 + <string>370 111 977 597 0 0 1440 878 </string>
376 367 </dict>
377 368 <key>Module</key>
378 369 <string>XCDetailModule</string>
@@ -396,9 +387,9 @@
396 387 </array>
397 388 <key>TableOfContents</key>
398 389 <array>
399   - <string>3F4E188E102DD2D800320118</string>
  390 + <string>3F4B66C3102E5449007EF718</string>
400 391 <string>1CE0B1FE06471DED0097A5F4</string>
401   - <string>3F4E188F102DD2D800320118</string>
  392 + <string>3F4B66C4102E5449007EF718</string>
402 393 <string>1CE0B20306471E060097A5F4</string>
403 394 <string>1CE0B20506471E060097A5F4</string>
404 395 </array>
@@ -532,11 +523,12 @@
532 523 <integer>5</integer>
533 524 <key>WindowOrderList</key>
534 525 <array>
535   - <string>3F4E1914102DD40B00320118</string>
  526 + <string>1C78EAAD065D492600B07095</string>
  527 + <string>1C530D57069F1CE1000CFCEE</string>
536 528 <string>/Users/jeremy/objective3/ElementParser/ElementParser.xcodeproj</string>
537 529 </array>
538 530 <key>WindowString</key>
539   - <string>6 129 977 597 0 0 1440 878 </string>
  531 + <string>370 111 977 597 0 0 1440 878 </string>
540 532 <key>WindowToolsV3</key>
541 533 <array>
542 534 <dict>
@@ -613,7 +605,7 @@
613 605 <key>TableOfContents</key>
614 606 <array>
615 607 <string>3F4E1914102DD40B00320118</string>
616   - <string>3F4E1915102DD40B00320118</string>
  608 + <string>3F526672102DE7C900389ECF</string>
617 609 <string>1CD0528F0623707200166675</string>
618 610 <string>XCMainBuildResultsModuleGUID</string>
619 611 </array>
@@ -729,8 +721,12 @@
729 721 <integer>0</integer>
730 722 </dict>
731 723 <dict>
  724 + <key>FirstTimeWindowDisplayed</key>
  725 + <false/>
732 726 <key>Identifier</key>
733 727 <string>windowTool.find</string>
  728 + <key>IsVertical</key>
  729 + <true/>
734 730 <key>Layout</key>
735 731 <array>
736 732 <dict>
@@ -740,44 +736,34 @@
740 736 <key>Dock</key>
741 737 <array>
742 738 <dict>
  739 + <key>BecomeActive</key>
  740 + <true/>
743 741 <key>ContentConfiguration</key>
744 742 <dict>
745 743 <key>PBXProjectModuleGUID</key>
746 744 <string>1CDD528C0622207200134675</string>
747 745 <key>PBXProjectModuleLabel</key>
748   - <string>&lt;No Editor&gt;</string>
749   - <key>PBXSplitModuleInNavigatorKey</key>
750   - <dict>
751   - <key>Split0</key>
752   - <dict>
753   - <key>PBXProjectModuleGUID</key>
754   - <string>1CD0528D0623707200166675</string>
755   - </dict>
756   - <key>SplitCount</key>
757   - <string>1</string>
758   - </dict>
  746 + <string>Element.m</string>
759 747 <key>StatusBarVisibility</key>
760   - <integer>1</integer>
  748 + <true/>
761 749 </dict>
762 750 <key>GeometryConfiguration</key>
763 751 <dict>
764 752 <key>Frame</key>
765   - <string>{{0, 0}, {781, 167}}</string>
  753 + <string>{{0, 0}, {948, 205}}</string>
766 754 <key>RubberWindowFrame</key>
767   - <string>62 385 781 470 0 0 1440 878 </string>
  755 + <string>391 88 948 597 0 0 1440 878 </string>
768 756 </dict>
769 757 <key>Module</key>
770 758 <string>PBXNavigatorGroup</string>
771 759 <key>Proportion</key>
772   - <string>781pt</string>
  760 + <string>948pt</string>
773 761 </dict>
774 762 </array>
775 763 <key>Proportion</key>
776   - <string>50%</string>
  764 + <string>205pt</string>
777 765 </dict>
778 766 <dict>
779   - <key>BecomeActive</key>
780   - <integer>1</integer>
781 767 <key>ContentConfiguration</key>
782 768 <dict>
783 769 <key>PBXProjectModuleGUID</key>
@@ -788,18 +774,18 @@
788 774 <key>GeometryConfiguration</key>
789 775 <dict>
790 776 <key>Frame</key>
791   - <string>{{8, 0}, {773, 254}}</string>
  777 + <string>{{0, 210}, {948, 346}}</string>
792 778 <key>RubberWindowFrame</key>
793   - <string>62 385 781 470 0 0 1440 878 </string>
  779 + <string>391 88 948 597 0 0 1440 878 </string>
794 780 </dict>
795 781 <key>Module</key>
796 782 <string>PBXProjectFindModule</string>
797 783 <key>Proportion</key>
798   - <string>50%</string>
  784 + <string>346pt</string>
799 785 </dict>
800 786 </array>
801 787 <key>Proportion</key>
802   - <string>428pt</string>
  788 + <string>556pt</string>
803 789 </dict>
804 790 </array>
805 791 <key>Name</key>
@@ -809,31 +795,33 @@
809 795 <string>PBXProjectFindModule</string>
810 796 </array>
811 797 <key>StatusbarIsVisible</key>
812   - <integer>1</integer>
  798 + <true/>
813 799 <key>TableOfContents</key>
814 800 <array>
815 801 <string>1C530D57069F1CE1000CFCEE</string>
816   - <string>1C530D58069F1CE1000CFCEE</string>
817   - <string>1C530D59069F1CE1000CFCEE</string>
  802 + <string>3F4B66BD102E542C007EF718</string>
  803 + <string>3F4B66BE102E542C007EF718</string>
818 804 <string>1CDD528C0622207200134675</string>
819   - <string>1C530D5A069F1CE1000CFCEE</string>
820   - <string>1CE0B1FE06471DED0097A5F4</string>
821 805 <string>1CD0528E0623707200166675</string>
822 806 </array>
823 807 <key>WindowString</key>
824   - <string>62 385 781 470 0 0 1440 878 </string>
  808 + <string>391 88 948 597 0 0 1440 878 </string>
825 809 <key>WindowToolGUID</key>
826 810 <string>1C530D57069F1CE1000CFCEE</string>
827 811 <key>WindowToolIsVisible</key>
828   - <integer>0</integer>
  812 + <false/>
829 813 </dict>
830 814 <dict>
831 815 <key>Identifier</key>
832 816 <string>MENUSEPARATOR</string>
833 817 </dict>
834 818 <dict>
  819 + <key>FirstTimeWindowDisplayed</key>
  820 + <false/>
835 821 <key>Identifier</key>
836 822 <string>windowTool.debuggerConsole</string>
  823 + <key>IsVertical</key>
  824 + <true/>
837 825 <key>Layout</key>
838 826 <array>
839 827 <dict>
@@ -841,7 +829,7 @@
841 829 <array>
842 830 <dict>
843 831 <key>BecomeActive</key>
844   - <integer>1</integer>
  832 + <true/>
845 833 <key>ContentConfiguration</key>
846 834 <dict>
847 835 <key>PBXProjectModuleGUID</key>
@@ -852,9 +840,9 @@
852 840 <key>GeometryConfiguration</key>
853 841 <dict>
854 842 <key>Frame</key>
855   - <string>{{0, 0}, {650, 250}}</string>
  843 + <string>{{0, 0}, {650, 209}}</string>
856 844 <key>RubberWindowFrame</key>
857   - <string>516 632 650 250 0 0 1680 1027 </string>
  845 + <string>391 435 650 250 0 0 1440 878 </string>
858 846 </dict>
859 847 <key>Module</key>
860 848 <string>PBXDebugCLIModule</string>
@@ -873,21 +861,21 @@
873 861 <string>PBXDebugCLIModule</string>
874 862 </array>
875 863 <key>StatusbarIsVisible</key>
876   - <integer>1</integer>
  864 + <true/>
877 865 <key>TableOfContents</key>
878 866 <array>
879 867 <string>1C78EAAD065D492600B07095</string>
880   - <string>1C78EAAE065D492600B07095</string>
  868 + <string>3F4B66C1102E5445007EF718</string>
881 869 <string>1C78EAAC065D492600B07095</string>
882 870 </array>
883 871 <key>ToolbarConfiguration</key>
884 872 <string>xcode.toolbar.config.consoleV3</string>
885 873 <key>WindowString</key>
886   - <string>650 41 650 250 0 0 1280 1002 </string>
  874 + <string>391 435 650 250 0 0 1440 878 </string>
887 875 <key>WindowToolGUID</key>
888 876 <string>1C78EAAD065D492600B07095</string>
889 877 <key>WindowToolIsVisible</key>
890   - <integer>0</integer>
  878 + <false/>
891 879 </dict>
892 880 <dict>
893 881 <key>Identifier</key>
114 ElementParser.xcodeproj/jeremy.pbxuser
@@ -30,22 +30,36 @@
30 30 PBXFileDataSource_Target_ColumnID,
31 31 );
32 32 };
33   - PBXPerProjectTemplateStateSaveDate = 271438550;
34   - PBXWorkspaceStateSaveDate = 271438550;
  33 + PBXPerProjectTemplateStateSaveDate = 271533379;
  34 + PBXWorkspaceStateSaveDate = 271533379;
35 35 };
36 36 perUserProjectItems = {
37   - 3F4E190D102DD40B00320118 /* PBXTextBookmark */ = 3F4E190D102DD40B00320118 /* PBXTextBookmark */;
38   - 3F4E190E102DD40B00320118 /* PBXTextBookmark */ = 3F4E190E102DD40B00320118 /* PBXTextBookmark */;
39   - 3F4E190F102DD40B00320118 /* PBXBookmark */ = 3F4E190F102DD40B00320118 /* PBXBookmark */;
40   - 3F4E1910102DD40B00320118 /* PBXTextBookmark */ = 3F4E1910102DD40B00320118 /* PBXTextBookmark */;
41   - 3F4E1911102DD40B00320118 /* PBXTextBookmark */ = 3F4E1911102DD40B00320118 /* PBXTextBookmark */;
42   - 3F4E1912102DD40B00320118 /* PBXTextBookmark */ = 3F4E1912102DD40B00320118 /* PBXTextBookmark */;
43   - 3F4E1913102DD40B00320118 /* PBXTextBookmark */ = 3F4E1913102DD40B00320118 /* PBXTextBookmark */;
  37 + 3F4B66BB102E542C007EF718 = 3F4B66BB102E542C007EF718 /* PBXTextBookmark */;
  38 + 3F4B66C2102E5449007EF718 = 3F4B66C2102E5449007EF718 /* PBXTextBookmark */;
  39 + 3F51DDF9102F45E100C8FA0A /* PBXTextBookmark */ = 3F51DDF9102F45E100C8FA0A /* PBXTextBookmark */;
  40 + 3F51DDFA102F45ED00C8FA0A /* PBXTextBookmark */ = 3F51DDFA102F45ED00C8FA0A /* PBXTextBookmark */;
44 41 };
45 42 sourceControlManager = 3F4E1887102DD29200320118 /* Source Control */;
46 43 userBuildSettings = {
47 44 };
48 45 };
  46 + 3F4B66BB102E542C007EF718 /* PBXTextBookmark */ = {
  47 + isa = PBXTextBookmark;
  48 + fRef = 3F4E18A4102DD2FA00320118 /* Element.m */;
  49 + rLen = 7;
  50 + rLoc = 1136;
  51 + rType = 0;
  52 + };
  53 + 3F4B66C2102E5449007EF718 /* PBXTextBookmark */ = {
  54 + isa = PBXTextBookmark;
  55 + fRef = 3F4E18A4102DD2FA00320118 /* Element.m */;
  56 + name = "Element.m: 29";
  57 + rLen = 0;
  58 + rLoc = 1011;
  59 + rType = 0;
  60 + vrLen = 673;
  61 + vrLoc = 762;
  62 + };
49 63 3F4E1887102DD29200320118 /* Source Control */ = {
50 64 isa = PBXSourceControlManager;
51 65 fallbackIsa = XCSourceControlManager;
@@ -73,9 +87,16 @@
73 87 };
74 88 3F4E18A3102DD2FA00320118 /* Element.h */ = {
75 89 uiCtxt = {
76   - sepNavIntBoundsRect = "{{0, 0}, {708, 3150}}";
77   - sepNavSelRange = "{0, 0}";
78   - sepNavVisRange = "{0, 942}";
  90 + sepNavIntBoundsRect = "{{0, 0}, {1021, 3136}}";
  91 + sepNavSelRange = "{1900, 0}";
  92 + sepNavVisRange = "{1147, 1354}";
  93 + };
  94 + };
  95 + 3F4E18A4102DD2FA00320118 /* Element.m */ = {
  96 + uiCtxt = {
  97 + sepNavIntBoundsRect = "{{0, 0}, {996, 3976}}";
  98 + sepNavSelRange = "{4024, 12}";
  99 + sepNavVisRange = "{3812, 507}";
79 100 };
80 101 };
81 102 3F4E18A5102DD2FA00320118 /* ElementParser.h */ = {
@@ -85,69 +106,22 @@
85 106 sepNavVisRange = "{767, 624}";
86 107 };
87 108 };
88   - 3F4E190D102DD40B00320118 /* PBXTextBookmark */ = {
89   - isa = PBXTextBookmark;
90   - fRef = 3F4E18A2102DD2FA00320118 /* DocumentRoot.m */;
91   - name = "DocumentRoot.m: 1";
92   - rLen = 0;
93   - rLoc = 0;
94   - rType = 0;
95   - vrLen = 938;
96   - vrLoc = 0;
97   - };
98   - 3F4E190E102DD40B00320118 /* PBXTextBookmark */ = {
  109 + 3F51DDF9102F45E100C8FA0A /* PBXTextBookmark */ = {
99 110 isa = PBXTextBookmark;
100   - fRef = 3F4E18A1102DD2FA00320118 /* DocumentRoot.h */;
101   - name = "DocumentRoot.h: 1";
102   - rLen = 0;
103   - rLoc = 0;
104   - rType = 0;
105   - vrLen = 873;
106   - vrLoc = 138;
107   - };
108   - 3F4E190F102DD40B00320118 /* PBXBookmark */ = {
109   - isa = PBXBookmark;
110   - fRef = 3F4E18A5102DD2FA00320118 /* ElementParser.h */;
111   - };
112   - 3F4E1910102DD40B00320118 /* PBXTextBookmark */ = {
113   - isa = PBXTextBookmark;
114   - fRef = 3F4E18A1102DD2FA00320118 /* DocumentRoot.h */;
115   - name = "DocumentRoot.h: 1";
116   - rLen = 0;
117   - rLoc = 0;
  111 + fRef = 3F4E18A4102DD2FA00320118 /* Element.m */;
  112 + rLen = 12;
  113 + rLoc = 4024;
118 114 rType = 0;
119   - vrLen = 947;
120   - vrLoc = 0;
121 115 };
122   - 3F4E1911102DD40B00320118 /* PBXTextBookmark */ = {
  116 + 3F51DDFA102F45ED00C8FA0A /* PBXTextBookmark */ = {
123 117 isa = PBXTextBookmark;
124   - fRef = 3F4E18A2102DD2FA00320118 /* DocumentRoot.m */;
125   - name = "DocumentRoot.m: 1";
126   - rLen = 0;
127   - rLoc = 0;
128   - rType = 0;
129   - vrLen = 938;
130   - vrLoc = 0;
131   - };
132   - 3F4E1912102DD40B00320118 /* PBXTextBookmark */ = {
133   - isa = PBXTextBookmark;
134   - fRef = 3F4E18A1102DD2FA00320118 /* DocumentRoot.h */;
135   - name = "DocumentRoot.h: 1";
136   - rLen = 0;
137   - rLoc = 0;
138   - rType = 0;
139   - vrLen = 873;
140   - vrLoc = 138;
141   - };
142   - 3F4E1913102DD40B00320118 /* PBXTextBookmark */ = {
143   - isa = PBXTextBookmark;
144   - fRef = 3F4E18A5102DD2FA00320118 /* ElementParser.h */;
145   - name = "ElementParser.h: 1";
146   - rLen = 0;
147   - rLoc = 0;
  118 + fRef = 3F4E18A4102DD2FA00320118 /* Element.m */;
  119 + name = "Element.m: 154";
  120 + rLen = 12;
  121 + rLoc = 4024;
148 122 rType = 0;
149   - vrLen = 624;
150   - vrLoc = 767;
  123 + vrLen = 507;
  124 + vrLoc = 3812;
151 125 };
152 126 D2AAC07D0554694100DB518D /* ElementParser */ = {
153 127 activeExec = 0;
2  ElementParser.xcodeproj/project.pbxproj
@@ -317,7 +317,7 @@
317 317 GCC_WARN_UNUSED_VARIABLE = YES;
318 318 OTHER_LDFLAGS = "-ObjC";
319 319 PREBINDING = NO;
320   - SDKROOT = iphoneos3.0;
  320 + SDKROOT = macosx10.5;
321 321 };
322 322 name = Debug;
323 323 };

0 comments on commit 1ed46e1

Please sign in to comment.
Something went wrong with that request. Please try again.