/*
* GPII JSON Settings Handler
*
* Copyright 2012 OpenDirective and Raising the Floor - International
*
* Licensed under the New BSD license. You may not use this file except in
* compliance with this License.
*
* The research leading to these results has received funding from the European Union's
* Seventh Framework Programme (FP7/2007-2013)
* under grant agreement no. 289016.
*
* You may obtain a copy of the License at
* https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
"use strict";
var fluid = require("infusion"),
settingsHandlers = fluid.registerNamespace("gpii.settingsHandlers"),
parser = fluid.registerNamespace("gpii.settingsHandlers.JSONSettingsHandler.parser");
parser.parse = function (content) {
return JSON.parse(content);
};
parser.stringify = function (content) {
return fluid.prettyPrintJSON(content);
};
/* PUBLIC API FUNCTIONS */
settingsHandlers.JSONSettingsHandler.get = settingsHandlers.makeFileGet(parser);
settingsHandlers.JSONSettingsHandler.set = settingsHandlers.makeFileSet(parser);
|