• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

iSightを使ってBooklog,MediaMarkerインポート用CSVファイルを生成するアプリ


Commit MetaInfo

Revisionf648e108a0fc86621367e2702144175f2fe0a707 (tree)
Time2011-06-01 21:39:47
Authormasakih <masakih@user...>
Commitermasakih

Log Message

[New] エクスポートファイルの最後にNewLineを追加出来るようにした。

Change Summary

Incremental Difference

--- a/BEBooksExporter.h
+++ b/BEBooksExporter.h
@@ -41,5 +41,6 @@ NSString *tagsString(NSArray *tags);
4141 - (NSString *)lineForBook:(BEBookInformation *)book;
4242 - (NSString *)lineSeparator; // default line sparator is CRLF.
4343 - (NSStringEncoding)fileEncoding; // default fileEncoding is NSShiftJISStringEncoding.
44+- (BOOL)needsNewLineToEndOfFile; // default is NO.
4445
4546 @end
--- a/BEBooksExporter.m
+++ b/BEBooksExporter.m
@@ -61,6 +61,9 @@
6161
6262 NSString *string = [lines componentsJoinedByString:[self lineSeparator]];
6363 [lines release]; lines = nil;
64+ if([self needsNewLineToEndOfFile]) {
65+ string = [string stringByAppendingString:[self lineSeparator]];
66+ }
6467 NSError *error = nil;
6568 BOOL isOK = NO;
6669 isOK = [string writeToURL:url atomically:YES encoding:[self fileEncoding] error:&error];
@@ -109,5 +112,6 @@ NSString *normalizeString(NSString *string)
109112 - (NSString *)lineForBook:(BEBookInformation *)book { return nil; }
110113 - (NSString *)lineSeparator { return @"\r\n"; }
111114 - (NSStringEncoding)fileEncoding { return NSShiftJISStringEncoding; }
115+- (BOOL)needsNewLineToEndOfFile { return NO; }
112116
113117 @end