Added setString: to CPData which sits on top of setSerializedPlistObject:.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2010-02-19 00:42:23 -08:00
1 parent 3a9845f784
commit 7819e174f1
3 files changed
+24 -2

No files matched your search

+15
View File
@@ -70,6 +70,11 @@
return self;
}
- (id)initWithString:(CPString)aString
{
return [self initWithSerializedPlistObject:aPlistObject];
}
- (id)initWithSerializedPlistObject:(id)aPlistObject
{
self = [super init];
@@ -90,6 +95,16 @@
return self;
}
- (void)setString:(CPString)aString
{
return [self setSerializedPlistObject:aString];
}
- (CPString)string
{
return [self serializedPlistObject];
}
- (int)length
{
return [[self encodedString] length];
+2 -2
View File
@@ -66,9 +66,9 @@ CFPropertyList.readPropertyListFromFile = function(/*String*/ aFilePath)
return CFPropertyList.propertyListFromString(FILE.read(aFilePath, { charset:"UTF-8" }));
}
CFPropertyList.writePropertyListToFile = function(/*CFPropertyList*/ aPropertyList, /*String*/ aFilePath)
CFPropertyList.writePropertyListToFile = function(/*CFPropertyList*/ aPropertyList, /*String*/ aFilePath, /*Format*/ aFormat)
{
return FILE.write(aFilePath, CFPropertyList.stringFromPropertyList(aPropertyList), { charset:"UTF-8" });
return FILE.write(aFilePath, CFPropertyList.stringFromPropertyList(aPropertyList, aFormat), { charset:"UTF-8" });
}
#endif
+7
View File
@@ -146,6 +146,13 @@ function preprocess(/*String*/ aString, /*String*/ aPath, /*unsigned*/ flags)
return new Preprocessor(aString, aPath, flags).executable();
}
objj_preprocess = preprocess;
objj_eval = function(/*String*/ aString)
{
return eval(objj_preprocess(aString).code());
}
function Preprocessor(/*String*/ aString, /*String*/ aPath, /*unsigned*/ flags)
{
// Remove the shebang.