mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-16 21:41:18 +00:00
Added setString: to CPData which sits on top of setSerializedPlistObject:.
Reviewed by me.
This commit is contained in:
1 parent
3a9845f784
commit
7819e174f1
3 files changed
+24
-2
No files matched your search
@@ -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];
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user