Skip to content

Added podspec and license file #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Dominik Wagner

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 6 additions & 7 deletions TCMXML/TCMXMLWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@

#import <Foundation/Foundation.h>

#define TCMWriterOptionNoOptions = 0UL;

enum {
typedef NS_OPTIONS(NSUInteger, TCMXMLWriterOptions)
{
TCMWriterOptionNoOptions = 0UL,
TCMXMLWriterOptionPrettyPrinted = 1UL << 0,
TCMXMLWriterOptionOrderedAttributes = 1UL << 1, // mainly for unit testing to get reproducible results, but can also be helpful otherwise for stable results
TCMXMLWriterOptionPrettyBOOL = 1UL << 2 // prints BOOLEAN NSNumbers as boolYESValue and boolNOValue values - default is "yes" and "no"
};
typedef NSUInteger TCMXMLWriterOptions;

@interface TCMXMLWriter : NSObject {}

Expand All @@ -26,10 +25,10 @@ typedef NSUInteger TCMXMLWriterOptions;
@property (nonatomic, strong) NSString *boolYESValue;
@property (nonatomic, strong) NSString *boolNOValue;

- (id)initWithOptions:(TCMXMLWriterOptions)anOptionField; // stores marshalled stuff in string
- (id)initWithOptions:(TCMXMLWriterOptions)anOptionField fileURL:(NSURL *)aFileURL;
- (instancetype)initWithOptions:(TCMXMLWriterOptions)anOptionField; // stores marshalled stuff in string
- (instancetype)initWithOptions:(TCMXMLWriterOptions)anOptionField fileURL:(NSURL *)aFileURL;
// stream must be open
- (id)initWithOptions:(TCMXMLWriterOptions)anOptionField outputStream:(NSOutputStream *)anOutputStream;
- (instancetype)initWithOptions:(TCMXMLWriterOptions)anOptionField outputStream:(NSOutputStream *)anOutputStream;

// meta
- (void)instructXMLStandalone; // <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Expand Down
8 changes: 4 additions & 4 deletions TCMXML/TCMXMLWriter.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ @implementation TCMXMLWriter

@synthesize fileURL = _fileURL;

- (id)init {
- (instancetype)init {
return [self initWithOptions:0];
}

- (id)initWithOptions:(TCMXMLWriterOptions)anOptionField {
- (instancetype)initWithOptions:(TCMXMLWriterOptions)anOptionField {
if ((self = [super init])) {
_elementNameStackArray = [NSMutableArray new];
self.writerOptions = anOptionField;
Expand All @@ -57,14 +57,14 @@ - (id)initWithOptions:(TCMXMLWriterOptions)anOptionField {
}
return self;
}
- (id)initWithOptions:(TCMXMLWriterOptions)anOptionField fileURL:(NSURL *)aFileURL {
- (instancetype)initWithOptions:(TCMXMLWriterOptions)anOptionField fileURL:(NSURL *)aFileURL {
if ((self = [self initWithOptions:anOptionField])) {
self.fileURL = aFileURL;
}
return self;
}

- (id)initWithOptions:(TCMXMLWriterOptions)anOptionField outputStream:(NSOutputStream *)anOutputStream {
- (instancetype)initWithOptions:(TCMXMLWriterOptions)anOptionField outputStream:(NSOutputStream *)anOutputStream {
if ((self = [self initWithOptions:anOptionField])) {
self.outputStream = anOutputStream;
}
Expand Down
14 changes: 14 additions & 0 deletions TCMXMLWriter.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Pod::Spec.new do |spec|
spec.name = 'TCMXMLWriter'
spec.version = '1.0.0'
spec.license = 'MIT'
spec.homepage = 'https://github.com/monkeydom/TCMXMLWriter'
spec.author = 'Dominik Wagner'
spec.summary = 'Elegant cocoa XML marshalling with a small memory footprint'
spec.source = { :git => 'https://github.com/monkeydom/TCMXMLWriter.git', :tag => spec.version.to_s }
spec.source_files = 'TCMXML/TCMXMLWriter.{h,m}'
spec.framework = 'Foundation'
spec.requires_arc = true
spec.ios.deployment_target = "6.0"
spec.osx.deployment_target = "10.8"
end