Added the iOS implementation of the FileSystem API.

This commit is contained in:
atanasovg
2014-04-23 18:48:28 +03:00
parent 322591d3ca
commit ce89af2643
7 changed files with 312 additions and 93 deletions

View File

@@ -52,9 +52,9 @@ export class UserPreferences {
if ("undefined" == typeof defaultValue) {
defaultValue = [];
}
var hashSet = utils_module.tk.utils.Collections.stringArrayToStringSet(defaultValue);
var hashSet = utils_module.Collections.stringArrayToStringSet(defaultValue);
var res = this.sharedPreferences.getStringSet(key, hashSet);
return utils_module.tk.utils.Collections.stringSetToStringArray(res);
return utils_module.Collections.stringSetToStringArray(res);
}
public setBoolean(key: string, value: boolean) {
@@ -90,7 +90,7 @@ export class UserPreferences {
public setStrings(key: string, values: string[]) {
var editor = this.sharedPreferences.edit();
var hashSet = utils_module.tk.utils.Collections.stringArrayToStringSet(values);
var hashSet = utils_module.Collections.stringArrayToStringSet(values);
editor.putStringSet(key, hashSet);
editor.commit();
}

View File

@@ -66,7 +66,7 @@ export class UserPreferences {
public getStrings(key: string, defaultValue?: string[]): string[] {
if (this.containsKey(key)) {
var nsArray = this.userDefaults.stringArrayForKey(key);
var jsArray = utils_module.tk.utils.Collections.nsArrayToJSArray(nsArray);
var jsArray = utils_module.Collections.nsArrayToJSArray(nsArray);
return jsArray;
}
if ("undefined" == typeof defaultValue) {
@@ -101,7 +101,7 @@ export class UserPreferences {
}
public setStrings(key: string, values: string[]) {
var nsArray = utils_module.tk.utils.Collections.jsArrayToNSArray(values);
var nsArray = utils_module.Collections.jsArrayToNSArray(values);
this.userDefaults.setObjectForKey(nsArray, key);
this.userDefaults.synchronize();
}