Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed parser with GPL license, now all the project is under MIT lic…

…ense [Thanks paintstripper]
  • Loading branch information...
commit d48e9381106067da8c5a53a1a59b60e564340b2c 1 parent 3e4112e
@AlvaroFranco authored
Showing with 889 additions and 3,684 deletions.
  1. +20 −114 AFFeedsReader.xcodeproj/project.pbxproj
  2. 0  AFFeedsReader.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  3. BIN  AFFeedsReader.xcodeproj/project.xcworkspace/xcuserdata/Alvaro.xcuserdatad/UserInterfaceState.xcuserstate
  4. BIN  AFFeedsReader.xcodeproj/project.xcworkspace/xcuserdata/daniel.beard.xcuserdatad/UserInterfaceState.xcuserstate
  5. 0  AFFeedsReader.xcodeproj/xcuserdata/Alvaro.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  6. 0  AFFeedsReader.xcodeproj/xcuserdata/Alvaro.xcuserdatad/xcschemes/AFFeedsReader.xcscheme
  7. 0  AFFeedsReader.xcodeproj/xcuserdata/Alvaro.xcuserdatad/xcschemes/xcschememanagement.plist
  8. +5 −0 AFFeedsReader.xcodeproj/xcuserdata/daniel.beard.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  9. +96 −0 AFFeedsReader.xcodeproj/xcuserdata/daniel.beard.xcuserdatad/xcschemes/AFFeedsReader.xcscheme
  10. +27 −0 AFFeedsReader.xcodeproj/xcuserdata/daniel.beard.xcuserdatad/xcschemes/xcschememanagement.plist
  11. 0  AFFeedsReader/AFFeedsReader-Info.plist
  12. 0  AFFeedsReader/AFFeedsReader-Prefix.pch
  13. 0  AFFeedsReader/AppDelegate.h
  14. 0  AFFeedsReader/AppDelegate.m
  15. +0 −35 AFFeedsReader/CDataChunk.h
  16. +0 −42 AFFeedsReader/CDataChunk.m
  17. +0 −47 AFFeedsReader/CSSPartMatcher.h
  18. +0 −105 AFFeedsReader/CSSPartMatcher.m
  19. +0 −68 AFFeedsReader/CSSSelector.h
  20. +0 −97 AFFeedsReader/CSSSelector.m
  21. +0 −48 AFFeedsReader/CSSSelectorMatcher.h
  22. +0 −60 AFFeedsReader/CSSSelectorMatcher.m
  23. +0 −67 AFFeedsReader/CSSSelectorPart.h
  24. +0 −161 AFFeedsReader/CSSSelectorPart.m
  25. +0 −117 AFFeedsReader/Chunk.h
  26. +0 −85 AFFeedsReader/Chunk.m
  27. +0 −36 AFFeedsReader/CommentChunk.h
  28. +0 −41 AFFeedsReader/CommentChunk.m
  29. +0 −36 AFFeedsReader/DoctypeChunk.h
  30. +0 −42 AFFeedsReader/DoctypeChunk.m
  31. +0 −30 AFFeedsReader/DocumentRoot.h
  32. +0 −48 AFFeedsReader/DocumentRoot.m
  33. +0 −243 AFFeedsReader/Element.h
  34. +0 −293 AFFeedsReader/Element.m
  35. +0 −115 AFFeedsReader/ElementParser.h
  36. +0 −276 AFFeedsReader/ElementParser.m
  37. +0 −37 AFFeedsReader/EntityChunk.h
  38. +0 −42 AFFeedsReader/EntityChunk.m
  39. +111 −0 AFFeedsReader/HTMLNode.h
  40. +412 −0 AFFeedsReader/HTMLNode.m
  41. +37 −0 AFFeedsReader/HTMLParser.h
  42. +135 −0 AFFeedsReader/HTMLParser.m
  43. 0  AFFeedsReader/Images/Screen shot 2012-09-27 at 19.16.29.png
  44. 0  AFFeedsReader/Images/Screen shot 2012-09-27 at 19.16.41.png
  45. 0  AFFeedsReader/Images/Screen shot 2012-09-27 at 19.16.53.png
  46. 0  AFFeedsReader/MainVC.h
  47. +44 −16 AFFeedsReader/MainVC.m
  48. +0 −183 AFFeedsReader/NSString_HTML.h
  49. +0 −662 AFFeedsReader/NSString_HTML.m
  50. +0 −36 AFFeedsReader/ProcessingInstructionChunk.h
  51. +0 −42 AFFeedsReader/ProcessingInstructionChunk.m
  52. 0  AFFeedsReader/ReaderVC.h
  53. +2 −2 AFFeedsReader/ReaderVC.m
  54. +0 −91 AFFeedsReader/TagChunk.h
  55. +0 −113 AFFeedsReader/TagChunk.m
  56. +0 −36 AFFeedsReader/TxtChunk.h
  57. +0 −38 AFFeedsReader/TxtChunk.m
  58. +0 −53 AFFeedsReader/URLParser.h
  59. +0 −127 AFFeedsReader/URLParser.m
  60. 0  AFFeedsReader/en.lproj/InfoPlist.strings
  61. 0  AFFeedsReader/main.m
  62. 0  AFFeedsReader/placeholder.png
  63. 0  AFFeedsReader/placeholdera.png
  64. 0  AFFeedsReaderTests/AFFeedsReaderTests-Info.plist
  65. 0  AFFeedsReaderTests/AFFeedsReaderTests.h
  66. 0  AFFeedsReaderTests/AFFeedsReaderTests.m
  67. 0  AFFeedsReaderTests/en.lproj/InfoPlist.strings
  68. 0  README.md
View
134 AFFeedsReader.xcodeproj/project.pbxproj 100644 → 100755
@@ -21,24 +21,6 @@
387F50C316078767004746E4 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 387F50C216078767004746E4 /* MapKit.framework */; };
387F50E11607A1A8004746E4 /* ODRefreshControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 387F50E01607A1A8004746E4 /* ODRefreshControl.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
387F50E31607A1F0004746E4 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 387F50E21607A1F0004746E4 /* QuartzCore.framework */; };
- 387F50E91607AD14004746E4 /* Gotham-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 387F50E81607AD14004746E4 /* Gotham-Regular.ttf */; };
- 3887B5761607716B005EBECF /* CDataChunk.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B5551607716B005EBECF /* CDataChunk.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B5771607716B005EBECF /* Chunk.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B5571607716B005EBECF /* Chunk.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B5781607716B005EBECF /* CommentChunk.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B5591607716B005EBECF /* CommentChunk.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B5791607716B005EBECF /* CSSPartMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B55B1607716B005EBECF /* CSSPartMatcher.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B57A1607716B005EBECF /* CSSSelector.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B55D1607716B005EBECF /* CSSSelector.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B57B1607716B005EBECF /* CSSSelectorMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B55F1607716B005EBECF /* CSSSelectorMatcher.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B57C1607716B005EBECF /* CSSSelectorPart.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B5611607716B005EBECF /* CSSSelectorPart.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B57D1607716B005EBECF /* DoctypeChunk.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B5631607716B005EBECF /* DoctypeChunk.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B57E1607716B005EBECF /* DocumentRoot.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B5651607716B005EBECF /* DocumentRoot.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B57F1607716B005EBECF /* Element.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B5671607716B005EBECF /* Element.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B5801607716B005EBECF /* ElementParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B5691607716B005EBECF /* ElementParser.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B5811607716B005EBECF /* EntityChunk.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B56B1607716B005EBECF /* EntityChunk.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B5821607716B005EBECF /* NSString_HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B56D1607716B005EBECF /* NSString_HTML.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B5831607716B005EBECF /* ProcessingInstructionChunk.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B56F1607716B005EBECF /* ProcessingInstructionChunk.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B5841607716B005EBECF /* TagChunk.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B5711607716B005EBECF /* TagChunk.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B5851607716B005EBECF /* TxtChunk.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B5731607716B005EBECF /* TxtChunk.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 3887B5861607716B005EBECF /* URLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 3887B5751607716B005EBECF /* URLParser.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
38CEA017160A5C5A00E9C793 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 38CEA016160A5C5A00E9C793 /* MBProgressHUD.m */; };
38DD131F16071515001F600C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38DD131E16071515001F600C /* UIKit.framework */; };
38DD132116071515001F600C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38DD132016071515001F600C /* Foundation.framework */; };
@@ -54,6 +36,8 @@
38DD135916071582001F600C /* MainVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 38DD135816071582001F600C /* MainVC.m */; };
38DD136016071680001F600C /* KMXMLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 38DD135F16071680001F600C /* KMXMLParser.m */; };
38DD136316071705001F600C /* ReaderVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 38DD136216071705001F600C /* ReaderVC.m */; };
+ 6B229B211623EAD70070CE8F /* HTMLNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B229B1E1623EAD70070CE8F /* HTMLNode.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+ 6B229B221623EAD70070CE8F /* HTMLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B229B201623EAD70070CE8F /* HTMLParser.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -94,41 +78,6 @@
387F50DF1607A1A8004746E4 /* ODRefreshControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ODRefreshControl.h; sourceTree = "<group>"; };
387F50E01607A1A8004746E4 /* ODRefreshControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ODRefreshControl.m; sourceTree = "<group>"; };
387F50E21607A1F0004746E4 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
- 387F50E81607AD14004746E4 /* Gotham-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gotham-Regular.ttf"; sourceTree = "<group>"; };
- 3887B5541607716B005EBECF /* CDataChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDataChunk.h; sourceTree = "<group>"; };
- 3887B5551607716B005EBECF /* CDataChunk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDataChunk.m; sourceTree = "<group>"; };
- 3887B5561607716B005EBECF /* Chunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Chunk.h; sourceTree = "<group>"; };
- 3887B5571607716B005EBECF /* Chunk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Chunk.m; sourceTree = "<group>"; };
- 3887B5581607716B005EBECF /* CommentChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommentChunk.h; sourceTree = "<group>"; };
- 3887B5591607716B005EBECF /* CommentChunk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommentChunk.m; sourceTree = "<group>"; };
- 3887B55A1607716B005EBECF /* CSSPartMatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPartMatcher.h; sourceTree = "<group>"; };
- 3887B55B1607716B005EBECF /* CSSPartMatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSPartMatcher.m; sourceTree = "<group>"; };
- 3887B55C1607716B005EBECF /* CSSSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSelector.h; sourceTree = "<group>"; };
- 3887B55D1607716B005EBECF /* CSSSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSSelector.m; sourceTree = "<group>"; };
- 3887B55E1607716B005EBECF /* CSSSelectorMatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSelectorMatcher.h; sourceTree = "<group>"; };
- 3887B55F1607716B005EBECF /* CSSSelectorMatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSSelectorMatcher.m; sourceTree = "<group>"; };
- 3887B5601607716B005EBECF /* CSSSelectorPart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSelectorPart.h; sourceTree = "<group>"; };
- 3887B5611607716B005EBECF /* CSSSelectorPart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSSelectorPart.m; sourceTree = "<group>"; };
- 3887B5621607716B005EBECF /* DoctypeChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DoctypeChunk.h; sourceTree = "<group>"; };
- 3887B5631607716B005EBECF /* DoctypeChunk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DoctypeChunk.m; sourceTree = "<group>"; };
- 3887B5641607716B005EBECF /* DocumentRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentRoot.h; sourceTree = "<group>"; };
- 3887B5651607716B005EBECF /* DocumentRoot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DocumentRoot.m; sourceTree = "<group>"; };
- 3887B5661607716B005EBECF /* Element.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Element.h; sourceTree = "<group>"; };
- 3887B5671607716B005EBECF /* Element.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Element.m; sourceTree = "<group>"; };
- 3887B5681607716B005EBECF /* ElementParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementParser.h; sourceTree = "<group>"; };
- 3887B5691607716B005EBECF /* ElementParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ElementParser.m; sourceTree = "<group>"; };
- 3887B56A1607716B005EBECF /* EntityChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EntityChunk.h; sourceTree = "<group>"; };
- 3887B56B1607716B005EBECF /* EntityChunk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EntityChunk.m; sourceTree = "<group>"; };
- 3887B56C1607716B005EBECF /* NSString_HTML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_HTML.h; sourceTree = "<group>"; };
- 3887B56D1607716B005EBECF /* NSString_HTML.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSString_HTML.m; sourceTree = "<group>"; };
- 3887B56E1607716B005EBECF /* ProcessingInstructionChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessingInstructionChunk.h; sourceTree = "<group>"; };
- 3887B56F1607716B005EBECF /* ProcessingInstructionChunk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProcessingInstructionChunk.m; sourceTree = "<group>"; };
- 3887B5701607716B005EBECF /* TagChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagChunk.h; sourceTree = "<group>"; };
- 3887B5711607716B005EBECF /* TagChunk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TagChunk.m; sourceTree = "<group>"; };
- 3887B5721607716B005EBECF /* TxtChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TxtChunk.h; sourceTree = "<group>"; };
- 3887B5731607716B005EBECF /* TxtChunk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TxtChunk.m; sourceTree = "<group>"; };
- 3887B5741607716B005EBECF /* URLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLParser.h; sourceTree = "<group>"; };
- 3887B5751607716B005EBECF /* URLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = URLParser.m; sourceTree = "<group>"; };
38CEA015160A5C5900E9C793 /* MBProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = "<group>"; };
38CEA016160A5C5A00E9C793 /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBProgressHUD.m; sourceTree = "<group>"; };
38DD131A16071515001F600C /* AFFeedsReader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AFFeedsReader.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -153,6 +102,10 @@
38DD135F16071680001F600C /* KMXMLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMXMLParser.m; sourceTree = "<group>"; };
38DD136116071705001F600C /* ReaderVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderVC.h; sourceTree = "<group>"; };
38DD136216071705001F600C /* ReaderVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderVC.m; sourceTree = "<group>"; };
+ 6B229B1D1623EAD70070CE8F /* HTMLNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLNode.h; sourceTree = "<group>"; };
+ 6B229B1E1623EAD70070CE8F /* HTMLNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLNode.m; sourceTree = "<group>"; };
+ 6B229B1F1623EAD70070CE8F /* HTMLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLParser.h; sourceTree = "<group>"; };
+ 6B229B201623EAD70070CE8F /* HTMLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLParser.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -220,47 +173,6 @@
path = ODRefreshControl;
sourceTree = "<group>";
};
- 3887B588160771AA005EBECF /* HTML Parser */ = {
- isa = PBXGroup;
- children = (
- 3887B5541607716B005EBECF /* CDataChunk.h */,
- 3887B5551607716B005EBECF /* CDataChunk.m */,
- 3887B5561607716B005EBECF /* Chunk.h */,
- 3887B5571607716B005EBECF /* Chunk.m */,
- 3887B5581607716B005EBECF /* CommentChunk.h */,
- 3887B5591607716B005EBECF /* CommentChunk.m */,
- 3887B55A1607716B005EBECF /* CSSPartMatcher.h */,
- 3887B55B1607716B005EBECF /* CSSPartMatcher.m */,
- 3887B55C1607716B005EBECF /* CSSSelector.h */,
- 3887B55D1607716B005EBECF /* CSSSelector.m */,
- 3887B55E1607716B005EBECF /* CSSSelectorMatcher.h */,
- 3887B55F1607716B005EBECF /* CSSSelectorMatcher.m */,
- 3887B5601607716B005EBECF /* CSSSelectorPart.h */,
- 3887B5611607716B005EBECF /* CSSSelectorPart.m */,
- 3887B5621607716B005EBECF /* DoctypeChunk.h */,
- 3887B5631607716B005EBECF /* DoctypeChunk.m */,
- 3887B5641607716B005EBECF /* DocumentRoot.h */,
- 3887B5651607716B005EBECF /* DocumentRoot.m */,
- 3887B5661607716B005EBECF /* Element.h */,
- 3887B5671607716B005EBECF /* Element.m */,
- 3887B5681607716B005EBECF /* ElementParser.h */,
- 3887B5691607716B005EBECF /* ElementParser.m */,
- 3887B56A1607716B005EBECF /* EntityChunk.h */,
- 3887B56B1607716B005EBECF /* EntityChunk.m */,
- 3887B56C1607716B005EBECF /* NSString_HTML.h */,
- 3887B56D1607716B005EBECF /* NSString_HTML.m */,
- 3887B56E1607716B005EBECF /* ProcessingInstructionChunk.h */,
- 3887B56F1607716B005EBECF /* ProcessingInstructionChunk.m */,
- 3887B5701607716B005EBECF /* TagChunk.h */,
- 3887B5711607716B005EBECF /* TagChunk.m */,
- 3887B5721607716B005EBECF /* TxtChunk.h */,
- 3887B5731607716B005EBECF /* TxtChunk.m */,
- 3887B5741607716B005EBECF /* URLParser.h */,
- 3887B5751607716B005EBECF /* URLParser.m */,
- );
- name = "HTML Parser";
- sourceTree = "<group>";
- };
38DD130F16071515001F600C = {
isa = PBXGroup;
children = (
@@ -298,6 +210,7 @@
38DD132416071515001F600C /* AFFeedsReader */ = {
isa = PBXGroup;
children = (
+ 6B229B231623EAD90070CE8F /* HTMLParsing */,
38DD132D16071515001F600C /* AppDelegate.h */,
38DD132E16071515001F600C /* AppDelegate.m */,
38DD135E16071680001F600C /* KMXMLParser.h */,
@@ -309,7 +222,6 @@
38CEA015160A5C5900E9C793 /* MBProgressHUD.h */,
38CEA016160A5C5A00E9C793 /* MBProgressHUD.m */,
387F509816078692004746E4 /* SDWebImage */,
- 3887B588160771AA005EBECF /* HTML Parser */,
387F50DE1607A1A8004746E4 /* ODRefreshControl */,
38DD132516071515001F600C /* Supporting Files */,
);
@@ -320,7 +232,6 @@
isa = PBXGroup;
children = (
3875701C1608991F002D0CD0 /* placeholder.png */,
- 387F50E81607AD14004746E4 /* Gotham-Regular.ttf */,
38DD132616071515001F600C /* AFFeedsReader-Info.plist */,
38DD132716071515001F600C /* InfoPlist.strings */,
38DD132A16071515001F600C /* main.m */,
@@ -348,6 +259,17 @@
name = "Supporting Files";
sourceTree = "<group>";
};
+ 6B229B231623EAD90070CE8F /* HTMLParsing */ = {
+ isa = PBXGroup;
+ children = (
+ 6B229B1D1623EAD70070CE8F /* HTMLNode.h */,
+ 6B229B1E1623EAD70070CE8F /* HTMLNode.m */,
+ 6B229B1F1623EAD70070CE8F /* HTMLParser.h */,
+ 6B229B201623EAD70070CE8F /* HTMLParser.m */,
+ );
+ name = HTMLParsing;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -419,7 +341,6 @@
buildActionMask = 2147483647;
files = (
38DD132916071515001F600C /* InfoPlist.strings in Resources */,
- 387F50E91607AD14004746E4 /* Gotham-Regular.ttf in Resources */,
3875701D1608991F002D0CD0 /* placeholder.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -460,23 +381,6 @@
38DD135916071582001F600C /* MainVC.m in Sources */,
38DD136016071680001F600C /* KMXMLParser.m in Sources */,
38DD136316071705001F600C /* ReaderVC.m in Sources */,
- 3887B5761607716B005EBECF /* CDataChunk.m in Sources */,
- 3887B5771607716B005EBECF /* Chunk.m in Sources */,
- 3887B5781607716B005EBECF /* CommentChunk.m in Sources */,
- 3887B5791607716B005EBECF /* CSSPartMatcher.m in Sources */,
- 3887B57A1607716B005EBECF /* CSSSelector.m in Sources */,
- 3887B57B1607716B005EBECF /* CSSSelectorMatcher.m in Sources */,
- 3887B57C1607716B005EBECF /* CSSSelectorPart.m in Sources */,
- 3887B57D1607716B005EBECF /* DoctypeChunk.m in Sources */,
- 3887B57E1607716B005EBECF /* DocumentRoot.m in Sources */,
- 3887B57F1607716B005EBECF /* Element.m in Sources */,
- 3887B5801607716B005EBECF /* ElementParser.m in Sources */,
- 3887B5811607716B005EBECF /* EntityChunk.m in Sources */,
- 3887B5821607716B005EBECF /* NSString_HTML.m in Sources */,
- 3887B5831607716B005EBECF /* ProcessingInstructionChunk.m in Sources */,
- 3887B5841607716B005EBECF /* TagChunk.m in Sources */,
- 3887B5851607716B005EBECF /* TxtChunk.m in Sources */,
- 3887B5861607716B005EBECF /* URLParser.m in Sources */,
387F50AD16078692004746E4 /* MKAnnotationView+WebCache.m in Sources */,
387F50AE16078692004746E4 /* SDImageCache.m in Sources */,
387F50AF16078692004746E4 /* SDWebImageDecoder.m in Sources */,
@@ -487,6 +391,8 @@
387F50B416078692004746E4 /* UIImageView+WebCache.m in Sources */,
387F50E11607A1A8004746E4 /* ODRefreshControl.m in Sources */,
38CEA017160A5C5A00E9C793 /* MBProgressHUD.m in Sources */,
+ 6B229B211623EAD70070CE8F /* HTMLNode.m in Sources */,
+ 6B229B221623EAD70070CE8F /* HTMLParser.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
0  AFFeedsReader.xcodeproj/project.xcworkspace/contents.xcworkspacedata 100644 → 100755
File mode changed
View
BIN  AFFeedsReader.xcodeproj/project.xcworkspace/xcuserdata/Alvaro.xcuserdatad/UserInterfaceState.xcuserstate 100644 → 100755
Binary file not shown
View
BIN  ...sReader.xcodeproj/project.xcworkspace/xcuserdata/daniel.beard.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
View
0  AFFeedsReader.xcodeproj/xcuserdata/Alvaro.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist 100644 → 100755
File mode changed
View
0  AFFeedsReader.xcodeproj/xcuserdata/Alvaro.xcuserdatad/xcschemes/AFFeedsReader.xcscheme 100644 → 100755
File mode changed
View
0  AFFeedsReader.xcodeproj/xcuserdata/Alvaro.xcuserdatad/xcschemes/xcschememanagement.plist 100644 → 100755
File mode changed
View
5 AFFeedsReader.xcodeproj/xcuserdata/daniel.beard.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Bucket
+ type = "1"
+ version = "1.0">
+</Bucket>
View
96 AFFeedsReader.xcodeproj/xcuserdata/daniel.beard.xcuserdatad/xcschemes/AFFeedsReader.xcscheme
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0450"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "38DD131916071515001F600C"
+ BuildableName = "AFFeedsReader.app"
+ BlueprintName = "AFFeedsReader"
+ ReferencedContainer = "container:AFFeedsReader.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "38DD133A16071516001F600C"
+ BuildableName = "AFFeedsReaderTests.octest"
+ BlueprintName = "AFFeedsReaderTests"
+ ReferencedContainer = "container:AFFeedsReader.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "38DD131916071515001F600C"
+ BuildableName = "AFFeedsReader.app"
+ BlueprintName = "AFFeedsReader"
+ ReferencedContainer = "container:AFFeedsReader.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "38DD131916071515001F600C"
+ BuildableName = "AFFeedsReader.app"
+ BlueprintName = "AFFeedsReader"
+ ReferencedContainer = "container:AFFeedsReader.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "38DD131916071515001F600C"
+ BuildableName = "AFFeedsReader.app"
+ BlueprintName = "AFFeedsReader"
+ ReferencedContainer = "container:AFFeedsReader.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
View
27 AFFeedsReader.xcodeproj/xcuserdata/daniel.beard.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>AFFeedsReader.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>38DD131916071515001F600C</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ <key>38DD133A16071516001F600C</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
View
0  AFFeedsReader/AFFeedsReader-Info.plist 100644 → 100755
File mode changed
View
0  AFFeedsReader/AFFeedsReader-Prefix.pch 100644 → 100755
File mode changed
View
0  AFFeedsReader/AppDelegate.h 100644 → 100755
File mode changed
View
0  AFFeedsReader/AppDelegate.m 100644 → 100755
File mode changed
View
35 AFFeedsReader/CDataChunk.h
@@ -1,35 +0,0 @@
-//
-// CDataChunk.h
-// Thumbprint
-//
-// Created by Lee Buck on 4/21/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import "Chunk.h"
-
-/**
- CDataChunk a chunk corresponding to a CDATA section
- */
-@interface CDataChunk : Chunk {
-
-}
-
-@end
View
42 AFFeedsReader/CDataChunk.m
@@ -1,42 +0,0 @@
-//
-// CDataChunk.m
-// Thumbprint
-//
-// Created by Lee Buck on 4/21/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CDataChunk.h"
-
-
-@implementation CDataChunk
-
--(NSString*)kind{
- return ChunkKindCData;
-}
-
--(NSRange)interiorRange{
- return NSMakeRange(range.location + 9, range.length - 12);
-}
-
-+(NSString*)humanName{
- return @"cdata";
-}
-
-@end
View
47 AFFeedsReader/CSSPartMatcher.h
@@ -1,47 +0,0 @@
-//
-// CSSPartMatcher.h
-// Thumbprint
-//
-// Created by Lee Buck on 4/19/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import "Element.h"
-@class CSSSelectorMatcher;
-
-/**
- * Responsible for representing a successful match on a part.
- * It is presented elements in an attempt to complete the next part of the match
- *
- */
-@interface CSSPartMatcher : NSObject {
- CSSSelectorMatcher* selectorMatcher; // not retained
- Element* matchedElement;
- int matchedPartIndex;
- NSMutableArray* matchersForNextPart;
-}
-@property (nonatomic, retain) Element* matchedElement;
-@property int matchedPartIndex;
-
--(id)initWithElement:(Element*) anElement selectorMatcher:(CSSSelectorMatcher*)aSelectorMatcher;
-//-(void)pruneMatchesForElement:(Element*)anElement;
--(BOOL)matchNextElement:(Element*) nextElement forIndex: (int) index;
-
-@end
View
105 AFFeedsReader/CSSPartMatcher.m
@@ -1,105 +0,0 @@
-//
-// CSSPartMatcher.m
-// Thumbprint
-//
-// Created by Lee Buck on 4/19/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CSSPartMatcher.h"
-#import "CSSSelectorPart.h"
-#import "CSSSelectorMatcher.h"
-
-@implementation CSSPartMatcher
-
-@synthesize matchedElement, matchedPartIndex;
-
--(id)initWithElement:(Element*) anElement selectorMatcher:(CSSSelectorMatcher*)aSelectorMatcher{
- self = [super init];
- matchedElement = [anElement retain];
- selectorMatcher = aSelectorMatcher;
- return self;
-}
-
--(void)dealloc{
-// NSLog(@"pruned: %@", [self description]);
- [matchedElement release];
- [matchersForNextPart release];
- [super dealloc];
-}
-
-/* we don't do this yet...
- -(void)pruneMatchesForElement: (Element*)anElement{
- if (!matchersForNextPart) return;
- for (CSSPartMatcher* match in matchersForNextPart){
- if ([match scopeElement] == anElement)
- [matchersForNextPart removeObject: match];
- else
- [match pruneMatchesForElement: anElement];
- }
-}
-*/
-
--(void)addNextMatch:(Element*)nextElement withIndex:(int)index{
- CSSPartMatcher* nextMatch = [[CSSPartMatcher alloc] initWithElement: nextElement selectorMatcher: selectorMatcher];
- nextMatch.matchedPartIndex = index;
- if (!matchersForNextPart)
- matchersForNextPart = [[NSMutableArray alloc] initWithCapacity: 4];
- [matchersForNextPart addObject: nextMatch];
- [nextMatch release];
-}
-
--(BOOL)matchNextElement:(Element*) nextElement forIndex: (int) index{
- CSSSelectorPart* nextPart = [[selectorMatcher selector] partAtIndex: index];
- CSSVerb nextVerb = [[selectorMatcher selector] verbAtIndex: index];
- BOOL verbMatches = NO;
- if ([nextPart matchesElement: nextElement]){
- if (nextVerb == CSSVerbAny)
- verbMatches = YES;
- else if (nextVerb == CSSVerbDescendant)
- verbMatches = [nextElement hasAncestor: self.matchedElement];//wasteful to not prune matches as they go out of scope
- else if (nextVerb == CSSVerbChild)
- verbMatches = nextElement.parent == self.matchedElement;
- else if (nextVerb == CSSVerbSuccessor)
- verbMatches = nextElement == self.matchedElement.nextSybling;
- }
-
- BOOL completeMatch = verbMatches && (index == [[selectorMatcher selector] countOfParts] - 1);
-
- if (matchersForNextPart){
- for (CSSPartMatcher* match in matchersForNextPart){
- completeMatch = completeMatch || [match matchNextElement: nextElement forIndex: index + 1];
- }
- }
-
- if (!completeMatch && verbMatches)//actually part and verb match
- [self addNextMatch: nextElement withIndex: index];
-
- return completeMatch;
-}
-
--(CSSSelectorPart*)matchedPart{
- return [[selectorMatcher selector] partAtIndex: matchedPartIndex];
-}
-
--(NSString*)description{
- return [NSString stringWithFormat: @"%@ matched %@ -- %i matchersForNextPart", [[self matchedPart] description], [matchedElement description], (matchersForNextPart) ? [matchersForNextPart count] : 0];
-}
-
-@end
View
68 AFFeedsReader/CSSSelector.h
@@ -1,68 +0,0 @@
-//
-// CSSSelector.h
-// Thumbprint
-//
-// Created by Lee Buck on 4/17/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import "Element.h"
-
-@class CSSSelectorMatcher;
-@class CSSSelectorPart;
-
-#define CSSVerbChild @" > "
-#define CSSVerbSuccessor @" + "
-#define CSSVerbDescendant @" "
-#define CSSVerbAny @""
-#define CSSVerb NSString*
-
-/**
- * CSSSelector is responsible for modeling a chain of CSSSelectorParts. For example
- *
- * body a.link
- *
- * is a chain of two parts "body" and "a.link"
- *
- * Parts are joined by "verbs" which correspond to symbols " ", "+", and ">"
- * These parts define the relative position of the second part to the first
- * Supported parts are:
- * space within - the second part must match an Element within the
- * Element matching the first part
- *
- * > child - the second part must match an Element whose parent is
- * the Element matching the first part
- *
- * + successor - the second part must match an Element whose previous
- * sybling was the Element matching the first part
- */
-
-@interface CSSSelector : NSObject {
- NSMutableArray* chain;
-}
--(id)initWithString:(NSString*)string;
--(NSString*)description;
-
--(int)countOfParts;
--(CSSSelectorPart*)partAtIndex:(int)index;
--(CSSVerb)verbAtIndex:(int)index;
--(CSSVerb)verbAfterIndex:(int)index;
-
-@end
View
97 AFFeedsReader/CSSSelector.m
@@ -1,97 +0,0 @@
-//
-// CSSSelector.m
-// Thumbprint
-//
-// Created by Lee Buck on 4/17/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CSSSelector.h"
-#import "CSSSelectorPart.h"
-#import "NSString_HTML.h"
-#import "CSSSelectorMatcher.h"
-
-
-@implementation CSSSelector
-
-
--(id)initWithString:(NSString*)string{
- CFStringInlineBuffer buffer;
- CFRange range = CFRangeMake(0, [string length]);
- CFStringInitInlineBuffer((CFStringRef)string, &buffer, range);
-
- chain = [[NSMutableArray alloc] initWithCapacity: 10];
- unichar c;
- CFIndex index = 0;
- while (c = skipWhitespace(&buffer, &index)){
- CSSSelectorPart* part = [[CSSSelectorPart alloc] initWithIndex: &index inBuffer: &buffer];
- [chain addObject: part];
- [part release];
-
- c = skipWhitespace(&buffer, &index);
- if (!c) break;
-
- if (c=='+'){
- [chain addObject: CSSVerbSuccessor];
- index++;
- }
- else if (c=='>'){
- [chain addObject: CSSVerbChild];
- index++;
- }
- else
- [chain addObject: CSSVerbDescendant];
- }
-
- return self;
-}
-
--(void)dealloc{
-// NSLog(@"disposing of %@", [self description]);
- [chain release];
- [super dealloc];
-}
-
--(NSString*)description{
- NSMutableString* result = [NSMutableString string];
- for (id item in chain){
- [result appendString: [item description]];
- }
- return result;
-}
-
--(int)countOfParts{
- return ([chain count] + 1) / 2;
-}
--(CSSSelectorPart*)partAtIndex:(int)index{
- return [chain objectAtIndex: index * 2];
-}
-
--(CSSVerb)verbAtIndex:(int)index{
- return (index > 0) ? [chain objectAtIndex: index * 2 - 1] : CSSVerbAny;
-}
-
-// sometime we need to access the next verb after an index... see scopingElement
--(CSSVerb)verbAfterIndex:(int)index{
- return (index < [self countOfParts] - 1) ? [self verbAtIndex: index + 1] : CSSVerbAny;
-}
-
-@end
-
-
View
48 AFFeedsReader/CSSSelectorMatcher.h
@@ -1,48 +0,0 @@
-//
-// CSSSelectorMatcher.h
-// Thumbprint
-//
-// Created by Lee Buck on 4/19/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import "Element.h"
-#import "CSSSelector.h"
-#import "CSSPartMatcher.h"
-
-/**
- * Responsible for matching a CSSSelector.
- * It does this by minting matching parts and creating
- * CSSPartMatchers for all intermediate potential matches
- *
- */
-
-@interface CSSSelectorMatcher : NSObject {
- CSSSelector* selector;
- CSSPartMatcher* rootMatch;
- NSMutableArray* matches;
-}
-@property (nonatomic, retain) CSSSelector* selector;
-@property (nonatomic, retain) NSMutableArray* matches;
-
--(id)initWithSelector:(CSSSelector*)selector;
--(BOOL)matchElement:(Element*) element;
--(Element*)firstMatch;
-@end
View
60 AFFeedsReader/CSSSelectorMatcher.m
@@ -1,60 +0,0 @@
-//
-// CSSSelectorMatcher.m
-// Thumbprint
-//
-// Created by Lee Buck on 4/19/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CSSSelectorMatcher.h"
-#import "CSSSelectorPart.h"
-
-@implementation CSSSelectorMatcher
-
-@synthesize selector, matches;
-
--(id)initWithSelector:(CSSSelector*)aSelector{
- self = [super init];
- selector = [aSelector retain];
- rootMatch = [[CSSPartMatcher alloc] initWithElement: nil selectorMatcher: self];
- matches = [[NSMutableArray alloc] initWithCapacity: 1];
- return self;
-}
-
--(void)dealloc{
- [selector release];
- [rootMatch release];
- [matches release];
- [super dealloc];
-}
-
--(Element*)firstMatch{
- return ([matches count] > 0) ? [matches objectAtIndex: 0] : nil;
-}
-
--(BOOL)matchElement:(Element*) element{
- if ([element isCloseTag]) return NO;
- BOOL matchComplete = [rootMatch matchNextElement: element forIndex: 0];
- if (matchComplete)
- [matches addObject: element];
- return matchComplete;
-}
-
-
-@end
View
67 AFFeedsReader/CSSSelectorPart.h
@@ -1,67 +0,0 @@
-//
-// CSSSelectorPart.h
-// Thumbprint
-//
-// Created by Lee Buck on 4/17/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import "Element.h"
-
-/**
- * CSSSelectorPart is responsible for modeling one part of CSSSelector. For example
- *
- * a.link[target]
- *
- * is a part which matches <a> tags which have a link class name and an attribute 'target'
- *
- * A part can consist of one or more of the following:
- *
- * * All elements match (used when no tagname is supplied)
- * tagname Matching elements have this tag name
- * #id Matching elements have this as their id attribute
- * .class Matching elements have this as one of their class names
- * [attr] Matching elements have this attribute (regarless of its value)
- * [attr=val] Matching elements have this attribute with this value
- *
- */
-
-
-@interface CSSSelectorPart : NSObject {
- NSString* identifier;
- NSString* tag;
- NSMutableArray* classNames;
- NSString* attrName;
- NSString* attrValue;
-}
-
-
-@property (nonatomic, retain) NSString* identifier;
-@property (nonatomic, retain) NSString* tag;
-@property (nonatomic, retain) NSArray* classNames;
-@property (nonatomic, retain) NSString* attrName;
-@property (nonatomic, retain) NSString* attrValue;
-
--(id)initWithIndex:(int*) index inString:(NSString*)string;
--(id)initWithIndex:(CFIndex*) index inBuffer:(CFStringInlineBuffer*)buffer;
--(NSString*)description;
--(BOOL)matchesElement:(Element*)element;
-
-@end
View
161 AFFeedsReader/CSSSelectorPart.m
@@ -1,161 +0,0 @@
-//
-// CSSSelectorPart.m
-// Thumbprint
-//
-// Created by Lee Buck on 4/17/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CSSSelectorPart.h"
-#import "NSString_HTML.h"
-
-@implementation CSSSelectorPart
-
-@synthesize identifier, tag, classNames, attrName, attrValue;
-
--(id)initWithIndex:(int*) index inString:(NSString*)string{
- CFStringInlineBuffer buffer;
- CFRange range = CFRangeMake(0, [string length]);
- CFStringInitInlineBuffer((CFStringRef)string, &buffer, range);
- CFIndex i = 0;
- self = [self initWithIndex: &i inBuffer: &buffer];
- *index = i;
- return self;
-
-}
-
--(id)initWithIndex:(CFIndex*) index inBuffer:(CFStringInlineBuffer*)buffer{
- unichar c;
- CFIndex len;
- c = skipWhitespace(buffer, index);
- while (c > 32){
- if (c=='#'){
- len = lenToken(buffer, *index + 1);
- assert(len);
- self.identifier = createStringFromBuffer(buffer, *index + 1, len);
- [self.identifier release];//retained by property setter
- (*index) += len + 1;
- }
- else if (c == '.'){
- len = lenToken(buffer, *index + 1);
- assert(len);
- NSString* className = createStringFromBuffer(buffer, *index + 1, len);
- if (!classNames)
- classNames = [[NSMutableArray alloc] initWithObjects: className, nil];
- else
- [classNames addObject: className];
- [className release];
- (*index) += len + 1;
- }
- else if (c == '['){
- (*index)++;
- c = skipWhitespace(buffer, index);
- len = lenToken(buffer, *index);
- assert(len);
- self.attrName = createStringFromBuffer(buffer, *index, len);
- [self.attrName release];//retained by property setter
- (*index) += len;
-
- c = skipWhitespace(buffer, index);
-
- if (c == '='){
- (*index)++;
- c = skipWhitespace(buffer, index);
- if (c=='\''){
- len = lenThru(buffer, (*index) + 1, "'");
- assert(len);
- self.attrValue = createStringFromBuffer(buffer, *index + 1, len-1);
- (*index)++;
- }
- else if (c == '"'){
- len = lenThru(buffer, (*index) + 1, "\"");
- assert(len);
- self.attrValue = createStringFromBuffer(buffer, *index + 1, len-1);
- (*index)++;
- }
- else{
- len = lenToken(buffer, (*index));
- assert(len);
- self.attrValue = createStringFromBuffer(buffer, *index, len);
- }
- [self.attrValue release];//retained by property setter
- (*index) += len;
- c = skipWhitespace(buffer, index);
- }
- assert(c==']');
- (*index) += 1;
- }
- else if (c == '*')
- (*index)++;
- else{
- len = lenToken(buffer, (*index));
- assert(len);
- self.tag = createStringFromBuffer(buffer, *index, len);
- [self.tag release];//retained by property setter
- (*index) += len;
- }
- c = CFStringGetCharacterFromInlineBuffer(buffer, *index);
- }
- return self;
-}
-
--(void)dealloc{
- [identifier release];
- [tag release];
- [classNames release];
- [attrName release];
- [attrValue release];
- [super dealloc];
-}
-
--(BOOL)matchesElement:(Element*)element{
- if(element.range.length == 0) return NO; //ElementParser's root
- if (tag && ![element tagNameEquals: tag]) return NO;
- if (identifier && ![identifier isEqualToString: [element attribute: @"id"]]) return NO;
- if (classNames){
- for (NSString* className in classNames)
- if (![element hasClassName: className])
- return NO;
- }
- if (attrName && attrValue && ![attrValue isEqualToString: [element attribute: attrName]]) return NO;
- if (attrName && ![element hasAttribute: attrName]) return NO;
- return YES;
-}
-
--(NSString*)description{
- NSMutableString* result = [NSMutableString string];
- if (tag)
- [result appendString: tag];
- if (identifier)
- [result appendFormat: @"#%@", identifier];
- if (classNames){
- for (NSString* className in classNames)
- [result appendFormat: @".%@", className];
- }
- if (attrName){
- [result appendFormat: @"[%@", attrName];
- if (attrValue)
- [result appendFormat: @"='%@']", attrValue];
- else
- [result appendString: @"]"];
- }
- return result;
-}
-
-@end
View
117 AFFeedsReader/Chunk.h
@@ -1,117 +0,0 @@
-//
-// Chunk.h
-// Thumbprint
-//
-// Created by Lee Buck on 4/21/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-
-#define ChunkKindDocument @"ChunkKindDocument"
-#define ChunkKindTag @"ChunkKindTag"
-#define ChunkKindPI @"ChunkKindPI"
-#define ChunkKindComment @"ChunkKindComment"
-#define ChunkKindEntity @"ChunkKindEntity"
-#define ChunkKindCData @"ChunkKindCData"
-#define ChunkKindDoctype @"ChunkKindDoctype"
-#define ChunkKindText @"ChunkKindText"
-
-/**
- Chunk is a range of source text that has been divided into a meaningful "chunk" by
- the NSString_HTML parser. Examples of a chunk include an element, a cdata section, an entity,
- character data, etc. It is an abstract base class that handles basic housekeeping.
- Subclasses include TagChunk, TxtChunk, CommentChunk, EntityChunk, etc.
- */
-@interface Chunk : NSObject {
- CFStringInlineBuffer* buffer;
- NSString* source;
- NSRange range;
-}
-
-
-
-/**
- A human readable name for the chunk. Used for debugging purposes.
- */
-+(NSString*)humanName;
-
-
-/**
- The string that contains the whole source being parsed.
- */
-@property (nonatomic, retain) NSString* source;
-
-
-/**
- The range within the source of this chunk. Includes delimiters like '<' and '>'
- */
-@property NSRange range;
-
-
-/** During the parse (only) this buffer provides faster access to individual characters */
-@property CFStringInlineBuffer* buffer;
-
-
-/**
- Only some of the whole string is buffered... when this chunk is delivered by the parser
- the whole chunk will be available in the buffer
- */
-@property (readonly) CFRange rangeInBuffer;
-
-
-/**
- The interior of a chunk ususally excludes the delimiters. This method does the index
- math to point inside the buffer. Currently only used to access the character
- data within a cdata section.
- */
-@property (readonly) CFRange interiorRangeInBuffer;
-
-
-/**
- Creates a new chunk from the range aRange in aSource string
- */
--(id)initWithString: (NSString*)aSource range:(NSRange)aRange;
-
-
-/**
- The interior of a chunk ususally excludes the delimiters of the chunk.
- */
--(NSRange)interiorRange;
-
-
-/**
- Convenience method that returns a string corresponding to the interior of the chunk.
- */
--(NSString*)interiorString;
-
-
-/**
- Each chunk has a kind denotes what type of chunk it is.
- */
--(NSString*)kind;
-
-
-/**
- Convenience method to test kind
- */
--(BOOL)isKind:(NSString*)aKind;
-
-
-@end
View
85 AFFeedsReader/Chunk.m
@@ -1,85 +0,0 @@
-//
-// Chunk.m
-// Thumbprint
-//
-// Created by Lee Buck on 4/21/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "Chunk.h"
-
-
-@implementation Chunk
-
-@synthesize source, range, buffer;
-
--(id)initWithString: (NSString*)aSource range:(NSRange)aRange{
- source = [aSource retain];
- range = aRange;
- return self;
-}
-
--(void)dealloc{
- [source release];
- [super dealloc];
-}
-
--(CFRange)rangeInBuffer{
- if (buffer)
- return CFRangeMake(range.location + buffer->rangeToBuffer.location, range.length);
- else
- return CFRangeMake(kCFNotFound, 0);
-}
-
--(CFRange)interiorRangeInBuffer{
- if (buffer){
- NSRange inRange = self.interiorRange;
- return CFRangeMake(inRange.location + buffer->rangeToBuffer.location, inRange.length);
- }
- else
- return CFRangeMake(kCFNotFound, 0);
-}
-
--(NSRange)interiorRange{
- return range;
-}
-
--(NSString*)interiorString{
- return [source substringWithRange: [self interiorRange]];
-}
-
--(NSString*)kind{
- [self doesNotRecognizeSelector: _cmd];
- return nil;
-}
-
--(BOOL)isKind:(NSString*)aKind{
- return aKind == [self kind];
-}
-
--(NSString*)description{
- return [source substringWithRange: range];
-}
-
-+(NSString*)humanName{
- return @"generic";
-}
-
-
-@end
View
36 AFFeedsReader/CommentChunk.h
@@ -1,36 +0,0 @@
-//
-// CommentChunk.h
-// Thumbprint
-//
-// Created by Lee Buck on 4/21/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import "Chunk.h"
-
-
-/**
- CommentChunk corresponds to a comment section.
- */
-@interface CommentChunk : Chunk {
-
-}
-
-@end
View
41 AFFeedsReader/CommentChunk.m
@@ -1,41 +0,0 @@
-//
-// CommentChunk.m
-// Thumbprint
-//
-// Created by Lee Buck on 4/21/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CommentChunk.h"
-
-
-@implementation CommentChunk
-
--(NSRange)interiorRange{
- return NSMakeRange(range.location + 4, range.length - 7);
-}
--(NSString*)kind{
- return ChunkKindComment;
-}
-
-+(NSString*)humanName{
- return @"comment";
-}
-
-@end
View
36 AFFeedsReader/DoctypeChunk.h
@@ -1,36 +0,0 @@
-//
-// DoctypeChunk.h
-// Thumbprint
-//
-// Created by Lee Buck on 4/25/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import "Chunk.h"
-
-/**
- DoctypeChunk corresponds to a Doctype section. Note that the parser does not
- extract declarations within an internal subset, and it ignores references to system and external ids.
- */
-@interface DoctypeChunk : Chunk {
-
-}
-
-@end
View
42 AFFeedsReader/DoctypeChunk.m
@@ -1,42 +0,0 @@
-//
-// DoctypeChunk.m
-// Thumbprint
-//
-// Created by Lee Buck on 4/25/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "DoctypeChunk.h"
-
-
-@implementation DoctypeChunk
-
--(NSString*)kind{
- return ChunkKindDoctype;
-}
-
--(NSRange)interiorRange{
- return NSMakeRange(range.location + 9, range.length - 10);
-}
-
-+(NSString*)humanName{
- return @"doctype";
-}
-
-@end
View
30 AFFeedsReader/DocumentRoot.h
@@ -1,30 +0,0 @@
-//
-// DocumentRoot.h
-// Thumbprint
-//
-// Created by Lee Buck on 4/21/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import "Element.h"
-
-@interface DocumentRoot : Element {
-}
-@end
View
48 AFFeedsReader/DocumentRoot.m
@@ -1,48 +0,0 @@
-//
-// DocumentRoot.m
-// Thumbprint
-//
-// Created by Lee Buck on 4/21/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "DocumentRoot.h"
-
-@implementation DocumentRoot
-
-
--(id)initWithString: (NSString*)aSource range:(NSRange)aRange{
- self = [super initWithString: aSource range:aRange tagName: @"DOCUMENT ROOT"];
- self.contentsLength = [aSource length];
- return self;
-}
-
--(NSString*)kind{
- return ChunkKindDocument;
-}
-
--(BOOL)isEmptyTag{
- return NO;
-}
-
--(BOOL)isCloseTag{
- return NO;
-}
-
-@end
View
243 AFFeedsReader/Element.h
@@ -1,243 +0,0 @@
-//
-// Element.h
-// Thumbprint
-//
-// Created by Lee Buck on 4/18/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import "TagChunk.h"
-
-@class CSSSelector;
-@class DocumentRoot;
-
-/**
- * An Element is the fundemental building block for ElementParser.
- */
-@interface Element : TagChunk {
- NSMutableDictionary* attributes;
- BOOL attributesParsed;
- Element* nextElement;
- Element* nextSybling;
- Element* parent;
- int contentsLength;
- NSString* contentsText;
- NSString* key;
- BOOL containsMarkup; // includes entities
-
- NSObject* domainObject;
-}
-
-/**
- * Returns a dictionary of attributes name/values.
- * If an attribute had no value in the source (e.g. <table noborders>) then the value will be NSNull
- * If the attributes have not yet been parsed, this will parser them first.
- */
-@property (nonatomic, readonly) NSDictionary* attributes;
-
-
-/**
- * The character data inside the element. This text is stripped of tags, whitespace, etc
- * by stripTags. To see the actual source within the element, use contentsSource
- */
-@property (nonatomic, retain) NSString* contentsText;
-
-
-/**
- * A case-normalized version of the tagName when appropriate. Used in situations
- * where the tag name might need to serve as a key into a dictionary
- */
-@property (nonatomic, retain) NSString* key;
-
-/**
- * One or more chunks where encountered within this element
- * Used for more efficient return of contentsText
- */
-@property BOOL containsMarkup;
-
-
-/**
- * The length of the text from the end of the start tag to the start of the end tag
- */
-@property int contentsLength;
-
-
-/**
- * The next Element encountered in the document
- */
-@property (nonatomic, retain) Element* nextElement;
-
-
-/**
- * The next sybling Element (ie the Element at the same depth with the same parent)
- */
-@property (nonatomic, retain) Element* nextSybling;
-
-
-/**
- * The parent Element to this Element
- */
-@property (nonatomic, assign) Element* parent;
-
-
-/**
- * Available for developer's use to hang an object onto this Element
- */
-@property (nonatomic, retain) NSObject* domainObject;
-
-
-/**
- * Parses the supplied source and return an Element tree with Document element serving as the root
- * or all top level elements. As HTML, Elements shall be considered case insensative and tag
- * specific heuristics will be used to close tags intelligently. See ElementParser for details.
- */
-+(DocumentRoot*)parseHTML:(NSString*)source;
-
-
-/**
- * Parses the supplied source and return an Element tree with Document element serving as the root
- * or all top level elements. XML, Elements shall be considered case sensative. See ElementParser for details.
- */
-+(DocumentRoot*)parseXML:(NSString*)source;
-
-/**
- * Initializer used by ElementParser. See TagChunk for other intializers
- */
--(id)initWithTag:(TagChunk*)tag caseSensative:(BOOL)aCaseSensative;
-
-
-/**
- * Returns true if the element contains the specified attribute.
- * If the attributes have not yet been parsed, this will parser them first.
- */
--(BOOL)hasAttribute:(NSString*)attr;
-
-
-/**
- * Returns the value of a particular attribute (or nil if it doesn't exist)
- * Note: ElementParser does not support default attributes
- * If the attributes have not yet been parsed, this will parser them first.
- */
--(NSString*)attribute:(NSString*)attr;
-
-
-/**
- * Convenience method to compare an element's tag name.
- * Comparision will be cases sensative for XML elements and insensative for HTML elements.
- */
--(BOOL)isEqualToString:(NSString*)string;
-
-/**
- * Convenience methods for getting NSObjects from elements and their children
- */
-- (NSString*)contentsTextOfChildElement:(NSString*)selector;
-
-- (NSNumber*)contentsNumber;
-
-- (NSNumber*)contentsNumberOfChildElement:(NSString*)selector;
-
-
-/**
- * An array of child Elements in document order
- */
--(NSArray*)childElements;
-
-/**
- * An array of child Elements in document order
- */
--(NSArray*)syblingElements;
-
-
-/**
- * The first child Element for this element (or nil if none).
- */
--(Element*)firstChild;
-
-
-/**
- * A dictionary containing the tagnames of children as keys
- * and the contentsText of the children as values.
- * If duplicate children tag names are encountered, only the last will
- * appear in the dictionary.
- */
--(NSDictionary*)contentsOfChildren;
-
-/**
- * Returns true if the supplied Element is a parent of receiver or one of its parents
- */
--(BOOL)hasAncestor:(Element*)ancestor;
-
-
-/**
- * Returns the nextElement but only if it has the scope Element as an ancestor
- */
--(Element*)nextElementWithinScope:(Element*)scope;
-
-
-/**
- * Returns true if the class attribute contains the class name (perhaps as one of multiple classes).
- */
--(BOOL)hasClassName:(NSString*)aClassName;
-
-
-/**
- * Returns true receiver can be a chlid of aParent. Used by ElementParser to prevent inappropriate
- * nesting in HTML (e.g. <p><p>)
- */
--(BOOL)acceptsParent:(Element*)aParent;
-
-/**
- * Debugging method
- */
--(NSString*)dumpTree;
-
-
-/**
- * The source between the end of the open tag and the beginning of the close tag
- */
--(NSString*)contentsSource;
-
-
-/**
- * Convenience method for using a selector to find elements within the receiver that match.
- * See CSSSelector for details.
- */
--(Element*)elementWithCSSSelector:(CSSSelector*)selector;
-
-/**
- * Convenience method for using a selector to find elements within the receiver that match
- * See CSSSelector for details.
- */
--(Element*)selectElement:(NSString*)cssSelectorString;
-
-
-/**
- * Convenience method for using a selector to find elements within the receiver that match
- * See CSSSelector for details.
- */
--(NSArray*)elementsWithCSSSelector:(CSSSelector*)selector;
-
-/**
- * Convenience method for using a selector to find elements within the receiver that match
- * See CSSSelector for details.
- */
--(NSArray*)selectElements:(NSString*)cssSelectorString;
-
-@end
View
293 AFFeedsReader/Element.m
@@ -1,293 +0,0 @@
-//
-// Element.m
-// Thumbprint
-//
-// Created by Lee Buck on 4/18/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "Element.h"
-#import "NSString_HTML.h"
-#import "CSSSelectorMatcher.h"
-#import "ElementParser.h"
-
-@interface Element ()
--(void)setAttributes:(NSDictionary*)dict;
-@end
-
-@implementation Element
-
-@synthesize nextElement, nextSybling, parent, contentsLength, contentsText, key, containsMarkup, domainObject;
-
-
-+(DocumentRoot*)parseHTML:(NSString*)source{
- ElementParser* parser = [[ElementParser alloc] init];
- DocumentRoot* root = [parser parseHTML: source];
- [[root retain] autorelease];
- [parser release];
- return root;
-}
-
-+(DocumentRoot*)parseXML:(NSString*)source{
- ElementParser* parser = [[ElementParser alloc] init];
- DocumentRoot* root = [parser parseXML: source];
- [[root retain] autorelease];
- [parser release];
- return root;
-}
-
--(id)initWithString:(NSString*)string{
- return [self initWithString: string range: NSMakeRange(0, [string length])];
-}
-
--(id)initWithTag:(TagChunk*)tag caseSensative:(BOOL)aCaseSensative{
- self = [self initWithString: tag.source range: tag.range tagName: tag.tagName];
- [self setCaseSensative: aCaseSensative];
- return self;
-}
-
--(void)dealloc{
- [attributes release];
- [contentsText release];
- [nextElement release];
- [nextSybling release];
- [key release];
- [super dealloc];
-}
-
-
--(void)setRange: (NSRange)aRange{
- attributesParsed = NO;
- [attributes removeAllObjects];
- [super setRange: aRange];
-}
-
-//cleans up nested p tags
--(BOOL)acceptsParent:(Element*)aParent{
- if ([self tagNameEquals: @"p"] && [aParent tagNameEquals: @"p"])
- return NO;
- return YES;
-}
-
-
--(BOOL)closesTag:(TagChunk*)aTag{
- if (self == aTag || [self isEmptyTag]) //former case is true when shouldBeEmptyTag
- return self == aTag;
- else
- return [super closesTag: aTag];
-}
-
--(BOOL)hasAttribute:(NSString*)attr{
- return [[[self attributes] allKeys] containsObject: attr];
-}
-
--(NSString*)attribute:(NSString*)attr{
- return [[self attributes] objectForKey: attr];
-}
-
-// warning, may contain empty classnames
--(NSArray*)classNames{
- NSString* classNames = [self attribute: @"class"];
- if (!classNames) return [NSArray array];
- return [classNames componentsSeparatedByCharactersInSet: [NSCharacterSet whitespaceCharacterSet]];
-}
-
--(BOOL)hasClassName:(NSString*)aClassName{
- if (![self attribute: @"class"]) return NO;
- for (NSString* className in [self classNames])
- if ([className isEqualToString: aClassName])
- return YES;
- return NO;
-}
-
--(NSDictionary*)attributes{
- if (!attributesParsed){
- [self setAttributes: [source parseElementAttributesWithRange: range caseSensative: [self caseSensative]]];
- attributesParsed = YES;
- }
- return attributes;
-}
-
--(void)setAttributes:(NSDictionary*)dict{
- [attributes release];
- attributes = [dict retain];
-}
-
--(Element*)firstChild{
- if ([nextElement parent] == self)
- return nextElement;
- else
- return nil;
-}
-
--(BOOL)hasAncestor:(Element*)ancestor{
- for (Element* p = parent; p; p = p.parent){
- if (p == ancestor)
- return YES;
- }
- return NO;
-}
-
--(Element*)nextElementWithinScope:(Element*)scope{
- if ((nextElement.parent == self) || nextSybling)
- return nextElement;
- else
- return ([nextElement hasAncestor: scope]) ? nextElement : nil;
-}
-
--(NSString*)contentsText{
- if (!contentsText){
-// NSRange contentsRange = NSMakeRange(NSMaxRange(range), contentsLength);
- self.contentsText = (containsMarkup) ? [[self contentsSource] stripTags] : [self contentsSource];//[source stringByReplacingEntitiesInRange: contentsRange];
- }
- return contentsText;
-}
-
-- (NSString*)contentsTextOfChildElement:(NSString*)selector {
- return [[self selectElement:selector] contentsText];
-}
-
-- (NSNumber*)contentsNumber {
- return [NSNumber numberWithInt:[[self contentsText] intValue]];
-}
-
-- (NSNumber*)contentsNumberOfChildElement:(NSString*)selector {
- return [[self selectElement:selector] contentsNumber];
-}
-
--(NSString*)contentsSource{
- NSRange contentsRange = NSMakeRange(NSMaxRange(range), contentsLength);
- NSString* result = [source substringWithRange: contentsRange];
- return result;
-}
-
--(NSArray*)selectElements:(NSString*)cssSelectorString{
- if (!cssSelectorString) return [NSArray array];
- CSSSelector* selector = [[CSSSelector alloc] initWithString: cssSelectorString];
- NSArray* result = [self elementsWithCSSSelector: selector];
- [selector release];
- return result;
-}
-
--(Element*)selectElement:(NSString*)cssSelectorString{
- if (!cssSelectorString) return nil;
- CSSSelector* selector = [[CSSSelector alloc] initWithString: cssSelectorString];
- Element* result = [self elementWithCSSSelector: selector];
- [selector release];
- return result;
-}
-
--(NSArray*)elementsWithCSSSelector:(CSSSelector*)selector{
- CSSSelectorMatcher* matcher = [[CSSSelectorMatcher alloc] initWithSelector: selector];
- Element* e = self;
- while (e){
- [matcher matchElement: e];
- // e = e.nextElement;
- e = [e nextElementWithinScope: self];
- }
- NSArray* result = [[[matcher matches] retain] autorelease];
- [matcher release];
- return result;
-}
-
--(Element*)elementWithCSSSelector:(CSSSelector*)selector{
- CSSSelectorMatcher* matcher = [[CSSSelectorMatcher alloc] initWithSelector: selector];
- Element* e = self;
- BOOL success = NO;
- while (e && !success){
- success = [matcher matchElement: e];
- e = [e nextElementWithinScope: self];
- }
- Element* result = [matcher firstMatch];
- [matcher release];
- return result;
-}
-
--(NSArray*)childElements{
- NSMutableArray* kids = [NSMutableArray array];
- Element* e = [self firstChild];
- while (e){
- [kids addObject: e];
- e = e.nextSybling;
- }
- return kids;
-}
-
--(NSArray*)syblingElements{
- NSMutableArray* syblings = [NSMutableArray array];
- Element* e = self;
- while (e){
- [syblings addObject: e];
- e = e.nextSybling;
- }
- return syblings;
-}
-
--(NSDictionary*)contentsOfChildren{
- NSMutableDictionary* result = [NSMutableDictionary dictionary];
- Element* e = [self firstChild];
- while (e){
- [result setObject: [e contentsText] forKey: [e key]];
- e = e.nextSybling;
- }
- return result;
-}
-
--(BOOL)isEqualToString:(NSString*)string{
- return [[self description] isEqualToString: string];
-}
-
--(NSString*)key{
- if (!key)
- self.key = ([self caseSensative])
- ? [self tagName]
- : [[self tagName] lowercaseString];
- return key;
-}
-
--(NSString*)description{
- NSMutableString* result = [NSMutableString string];
- if (!source) return result;//root element has no source
- [result appendString: @"<"];
- [result appendString: [self tagName]];
- for (NSString* att in [[self attributes] allKeys]){
- [result appendFormat: @" %@='%@'", att, [attributes objectForKey: att]];
- }
- if ([self isEmptyTag])
- [result appendString: @" />"];
- else
- [result appendString: @">"];
- return result;
-}
-
--(NSString*)dumpTree{
- NSMutableString* result = [NSMutableString string];
- Element* e = self;
- while (e){
- for (Element* ee = e; ee; ee = [ee parent])
- [result appendString: @" "];
- [result appendString: [e description]];
- NSString* txt = (e.containsMarkup) ? @"..." : e.contentsText;
- [result appendFormat: @"%@\n", txt];
- e = e.nextElement;
- }
- return result;
-}
-
-@end
View
115 AFFeedsReader/ElementParser.h
@@ -1,115 +0,0 @@
-//
-// ElementParser.h
-// Thumbprint
-//
-// Created by Lee Buck on 4/20/09.
-// Copyright 2009 Blue Bright Ventures. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Commercial licences without many of the obligations of GPL
-// are available for a nomial fee at sales@touchtankapps.com.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import "Element.h"
-#import "DocumentRoot.h"
-
-typedef enum{
- ElementParserModeHTML,
- ElementParserModeXML
-} ElementParserMode;
-
-#define ElementParserErrorDomain 1022
-typedef enum{
- ElementParserTagNotClosedError = -1,
- ElementParserGeneralError = -2
-}ElementParserErrors;
-
-@interface ElementParser : NSObject {
- NSMutableArray* tagStack;
- DocumentRoot* root;
- Element* lastOpened; //assigned
- Element* lastClosedBeforeOpen;
- Chunk* lastChunk;
-
- CFMutableArrayRef callbackMethods;
- NSMutableArray* callbackMatchers;
- id delegate;
- ElementParserMode mode;
-}
-
-/**
- * The delegate that is called when selectors match
- */
-@property (nonatomic, assign)