Permalink
Browse files

adding an enml to html transformer

This allows viewing of notes in a UIWebView
  • Loading branch information...
1 parent 2c9229f commit 9c616ddd2cd7c9ea8ff034cc23e7356859f3fcde mustafa committed Feb 6, 2013
@@ -154,6 +154,28 @@
A9AD4C5B16BA0572005609A6 /* EvernoteBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = A9AD4C4016BA0572005609A6 /* EvernoteBridge.h */; };
A9B1E82016C056B700D54760 /* MoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E81F16C056B700D54760 /* MoreViewController.m */; };
A9B1E82716C1E73900D54760 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9B1E82616C1E73900D54760 /* StoreKit.framework */; };
+ A9B1E86616C2242200D54760 /* KSForwardingWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = A9B1E85B16C2242200D54760 /* KSForwardingWriter.h */; };
+ A9B1E86716C2242200D54760 /* KSForwardingWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E85C16C2242200D54760 /* KSForwardingWriter.m */; };
+ A9B1E86816C2242200D54760 /* KSForwardingWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E85C16C2242200D54760 /* KSForwardingWriter.m */; };
+ A9B1E86916C2242200D54760 /* KSHTMLWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = A9B1E85D16C2242200D54760 /* KSHTMLWriter.h */; };
+ A9B1E86A16C2242200D54760 /* KSHTMLWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E85E16C2242200D54760 /* KSHTMLWriter.m */; };
+ A9B1E86B16C2242200D54760 /* KSHTMLWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E85E16C2242200D54760 /* KSHTMLWriter.m */; };
+ A9B1E86C16C2242200D54760 /* KSWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = A9B1E85F16C2242200D54760 /* KSWriter.h */; };
+ A9B1E86D16C2242200D54760 /* KSWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E86016C2242200D54760 /* KSWriter.m */; };
+ A9B1E86E16C2242200D54760 /* KSWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E86016C2242200D54760 /* KSWriter.m */; };
+ A9B1E86F16C2242200D54760 /* KSXMLAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = A9B1E86116C2242200D54760 /* KSXMLAttributes.h */; };
+ A9B1E87016C2242200D54760 /* KSXMLAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E86216C2242200D54760 /* KSXMLAttributes.m */; };
+ A9B1E87116C2242200D54760 /* KSXMLAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E86216C2242200D54760 /* KSXMLAttributes.m */; };
+ A9B1E87216C2242200D54760 /* KSXMLWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = A9B1E86316C2242200D54760 /* KSXMLWriter.h */; };
+ A9B1E87316C2242200D54760 /* KSXMLWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E86416C2242200D54760 /* KSXMLWriter.m */; };
+ A9B1E87416C2242200D54760 /* KSXMLWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E86416C2242200D54760 /* KSXMLWriter.m */; };
+ A9B1E87516C2242200D54760 /* LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = A9B1E86516C2242200D54760 /* LICENSE.txt */; };
+ A9B1E87A16C2259F00D54760 /* NSString+XMLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = A9B1E87816C2259F00D54760 /* NSString+XMLAdditions.h */; };
+ A9B1E87B16C2259F00D54760 /* NSString+XMLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E87916C2259F00D54760 /* NSString+XMLAdditions.m */; };
+ A9B1E87C16C2259F00D54760 /* NSString+XMLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E87916C2259F00D54760 /* NSString+XMLAdditions.m */; };
+ A9B1E88B16C2F99A00D54760 /* NSDataBase64Additions.h in Headers */ = {isa = PBXBuildFile; fileRef = A9B1E88916C2F99A00D54760 /* NSDataBase64Additions.h */; };
+ A9B1E88C16C2F99A00D54760 /* NSDataBase64Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E88A16C2F99A00D54760 /* NSDataBase64Additions.m */; };
+ A9B1E88D16C2F99A00D54760 /* NSDataBase64Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E88A16C2F99A00D54760 /* NSDataBase64Additions.m */; };
A9C552F816B5915200A97E48 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C552F716B5915200A97E48 /* Default-568h@2x.png */; };
A9C554FC16712F17006E0020 /* NSDate+EDAMAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C554FA16712F17006E0020 /* NSDate+EDAMAdditions.h */; };
A9C554FD16712F17006E0020 /* NSDate+EDAMAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C554FB16712F17006E0020 /* NSDate+EDAMAdditions.m */; };
@@ -300,6 +322,21 @@
A9B1E81E16C056B700D54760 /* MoreViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoreViewController.h; sourceTree = "<group>"; };
A9B1E81F16C056B700D54760 /* MoreViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MoreViewController.m; sourceTree = "<group>"; };
A9B1E82616C1E73900D54760 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
+ A9B1E85B16C2242200D54760 /* KSForwardingWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSForwardingWriter.h; sourceTree = "<group>"; };
+ A9B1E85C16C2242200D54760 /* KSForwardingWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSForwardingWriter.m; sourceTree = "<group>"; };
+ A9B1E85D16C2242200D54760 /* KSHTMLWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSHTMLWriter.h; sourceTree = "<group>"; };
+ A9B1E85E16C2242200D54760 /* KSHTMLWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSHTMLWriter.m; sourceTree = "<group>"; };
+ A9B1E85F16C2242200D54760 /* KSWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSWriter.h; sourceTree = "<group>"; };
+ A9B1E86016C2242200D54760 /* KSWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSWriter.m; sourceTree = "<group>"; };
+ A9B1E86116C2242200D54760 /* KSXMLAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSXMLAttributes.h; sourceTree = "<group>"; };
+ A9B1E86216C2242200D54760 /* KSXMLAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSXMLAttributes.m; sourceTree = "<group>"; };
+ A9B1E86316C2242200D54760 /* KSXMLWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSXMLWriter.h; sourceTree = "<group>"; };
+ A9B1E86416C2242200D54760 /* KSXMLWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSXMLWriter.m; sourceTree = "<group>"; };
+ A9B1E86516C2242200D54760 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE.txt; sourceTree = "<group>"; };
+ A9B1E87816C2259F00D54760 /* NSString+XMLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+XMLAdditions.h"; sourceTree = "<group>"; };
+ A9B1E87916C2259F00D54760 /* NSString+XMLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+XMLAdditions.m"; sourceTree = "<group>"; };
+ A9B1E88916C2F99A00D54760 /* NSDataBase64Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDataBase64Additions.h; sourceTree = "<group>"; };
+ A9B1E88A16C2F99A00D54760 /* NSDataBase64Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDataBase64Additions.m; sourceTree = "<group>"; };
A9C552F716B5915200A97E48 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../../../Default-568h@2x.png"; sourceTree = "<group>"; };
A9C554FA16712F17006E0020 /* NSDate+EDAMAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+EDAMAdditions.h"; sourceTree = "<group>"; };
A9C554FB16712F17006E0020 /* NSDate+EDAMAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+EDAMAdditions.m"; sourceTree = "<group>"; };
@@ -353,6 +390,7 @@
0B943F241525015500DB20A3 /* 3rdParty */ = {
isa = PBXGroup;
children = (
+ A9B1E85A16C2242200D54760 /* KSHTMLWriter */,
A96FE4EB16A0A3DB00F1AD8C /* AFNetworking */,
0B943F251525015500DB20A3 /* cocoa-oauth */,
0B943F2B1525015500DB20A3 /* NSString+URLEncoding */,
@@ -700,9 +738,31 @@
path = Bridge;
sourceTree = "<group>";
};
+ A9B1E85A16C2242200D54760 /* KSHTMLWriter */ = {
+ isa = PBXGroup;
+ children = (
+ A9B1E87816C2259F00D54760 /* NSString+XMLAdditions.h */,
+ A9B1E87916C2259F00D54760 /* NSString+XMLAdditions.m */,
+ A9B1E85B16C2242200D54760 /* KSForwardingWriter.h */,
+ A9B1E85C16C2242200D54760 /* KSForwardingWriter.m */,
+ A9B1E85D16C2242200D54760 /* KSHTMLWriter.h */,
+ A9B1E85E16C2242200D54760 /* KSHTMLWriter.m */,
+ A9B1E85F16C2242200D54760 /* KSWriter.h */,
+ A9B1E86016C2242200D54760 /* KSWriter.m */,
+ A9B1E86116C2242200D54760 /* KSXMLAttributes.h */,
+ A9B1E86216C2242200D54760 /* KSXMLAttributes.m */,
+ A9B1E86316C2242200D54760 /* KSXMLWriter.h */,
+ A9B1E86416C2242200D54760 /* KSXMLWriter.m */,
+ A9B1E86516C2242200D54760 /* LICENSE.txt */,
+ );
+ path = KSHTMLWriter;
+ sourceTree = "<group>";
+ };
A9C554F416712E8D006E0020 /* Utilities */ = {
isa = PBXGroup;
children = (
+ A9B1E88916C2F99A00D54760 /* NSDataBase64Additions.h */,
+ A9B1E88A16C2F99A00D54760 /* NSDataBase64Additions.m */,
A9C554FA16712F17006E0020 /* NSDate+EDAMAdditions.h */,
A9C554FB16712F17006E0020 /* NSDate+EDAMAdditions.m */,
A92602BD1672B6DD00F01E63 /* NSData+EvernoteSDK.h */,
@@ -772,6 +832,13 @@
A9AD4C5516BA0572005609A6 /* ENResourceAttachment.h in Headers */,
A9AD4C5816BA0572005609A6 /* ENSearchRequest.h in Headers */,
A9AD4C5B16BA0572005609A6 /* EvernoteBridge.h in Headers */,
+ A9B1E86616C2242200D54760 /* KSForwardingWriter.h in Headers */,
+ A9B1E86916C2242200D54760 /* KSHTMLWriter.h in Headers */,
+ A9B1E86C16C2242200D54760 /* KSWriter.h in Headers */,
+ A9B1E86F16C2242200D54760 /* KSXMLAttributes.h in Headers */,
+ A9B1E87216C2242200D54760 /* KSXMLWriter.h in Headers */,
+ A9B1E87A16C2259F00D54760 /* NSString+XMLAdditions.h in Headers */,
+ A9B1E88B16C2F99A00D54760 /* NSDataBase64Additions.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -871,6 +938,7 @@
A96E28E1165594480031EC63 /* Localizable.strings in Resources */,
A92602BC1672B4FE00F01E63 /* evernote_logo_4c-sm.png in Resources */,
A9C552F816B5915200A97E48 /* Default-568h@2x.png in Resources */,
+ A9B1E87516C2242200D54760 /* LICENSE.txt in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -962,6 +1030,13 @@
A9AD4C5316BA0572005609A6 /* ENNoteViewRequest.m in Sources */,
A9AD4C5616BA0572005609A6 /* ENResourceAttachment.m in Sources */,
A9AD4C5916BA0572005609A6 /* ENSearchRequest.m in Sources */,
+ A9B1E86716C2242200D54760 /* KSForwardingWriter.m in Sources */,
+ A9B1E86A16C2242200D54760 /* KSHTMLWriter.m in Sources */,
+ A9B1E86D16C2242200D54760 /* KSWriter.m in Sources */,
+ A9B1E87016C2242200D54760 /* KSXMLAttributes.m in Sources */,
+ A9B1E87316C2242200D54760 /* KSXMLWriter.m in Sources */,
+ A9B1E87B16C2259F00D54760 /* NSString+XMLAdditions.m in Sources */,
+ A9B1E88C16C2F99A00D54760 /* NSDataBase64Additions.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1015,6 +1090,13 @@
A9AD4C5716BA0572005609A6 /* ENResourceAttachment.m in Sources */,
A9AD4C5A16BA0572005609A6 /* ENSearchRequest.m in Sources */,
A9B1E82016C056B700D54760 /* MoreViewController.m in Sources */,
+ A9B1E86816C2242200D54760 /* KSForwardingWriter.m in Sources */,
+ A9B1E86B16C2242200D54760 /* KSHTMLWriter.m in Sources */,
+ A9B1E86E16C2242200D54760 /* KSWriter.m in Sources */,
+ A9B1E87116C2242200D54760 /* KSXMLAttributes.m in Sources */,
+ A9B1E87416C2242200D54760 /* KSXMLWriter.m in Sources */,
+ A9B1E87C16C2259F00D54760 /* NSString+XMLAdditions.m in Sources */,
+ A9B1E88D16C2F99A00D54760 /* NSDataBase64Additions.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -0,0 +1,50 @@
+//
+// KSForwardingWriter.h
+//
+// Copyright (c) 2010, Mike Abdullah and Karelia Software
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL MIKE ABDULLAH OR KARELIA SOFTWARE BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Abstract base class for any writers that operate by sending strings along to an output writer.
+//
+
+
+#import <Foundation/Foundation.h>
+#import "KSWriter.h"
+
+
+@interface KSForwardingWriter : NSObject <KSWriter>
+{
+@private
+ id <KSWriter> _writer;
+}
+
+#pragma mark Creating a Writer
+- (id)initWithOutputWriter:(id <KSWriter>)stream; // designated initializer
+- (id)init; // calls -initWithOutputWriter with nil. Handy for iteration & deriving info, but not a lot else
+
+
+#pragma mark Primitive
+
+- (void)writeString:(NSString *)string; // calls -writeString: on our string stream. Override to customize raw writing
+
+
+@end
@@ -0,0 +1,70 @@
+//
+// KSForwardingWriter.m
+//
+// Copyright (c) 2010, Mike Abdullah and Karelia Software
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL MIKE ABDULLAH OR KARELIA SOFTWARE BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+
+
+#import "KSForwardingWriter.h"
+
+
+@implementation KSForwardingWriter
+
+#pragma mark Init & Dealloc
+
+- (id)initWithOutputWriter:(id <KSWriter>)output; // designated initializer
+{
+ self = [super init];
+ if (self != nil) {
+ _writer = output;
+ }
+ return self;
+}
+
+- (id)init;
+{
+ return [self initWithOutputWriter:nil];
+}
+
+- (void)dealloc
+{
+ [self close];
+ NSAssert(!_writer, @"-close failed to dispose of output writer");
+
+}
+
+#pragma mark Writer Status
+
+- (void)close;
+{
+ _writer = nil;
+}
+
+#pragma mark Primitive
+
+- (void)writeString:(NSString *)string;
+{
+ [_writer writeString:string];
+}
+
+@end
Oops, something went wrong.

0 comments on commit 9c616dd

Please sign in to comment.