Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 34A5410A06 for ; Mon, 22 Apr 2013 18:59:29 +0000 (UTC) Received: (qmail 16345 invoked by uid 500); 22 Apr 2013 18:59:28 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 16284 invoked by uid 500); 22 Apr 2013 18:59:28 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 16080 invoked by uid 99); 22 Apr 2013 18:59:28 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Apr 2013 18:59:28 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E3A2681DA88; Mon, 22 Apr 2013 18:59:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: filmaj@apache.org To: commits@cordova.apache.org Date: Mon, 22 Apr 2013 18:59:37 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [11/15] fetch tests in jasmine http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.xib ---------------------------------------------------------------------- diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.xib b/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.xib new file mode 100644 index 0000000..cc8dd65 --- /dev/null +++ b/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.xib @@ -0,0 +1,875 @@ + + + + 768 + 10K540 + 851 + 1038.36 + 461.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 141 + + + YES + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 292 + + YES + + + -2147483374 + {480, 229} + + + + 1 + MCAwIDAAA + + YES + YES + IBCocoaTouchFramework + 1 + YES + + + + 266 + {{0, 256}, {480, 44}} + + + NO + NO + IBCocoaTouchFramework + 1 + + YES + + IBCocoaTouchFramework + 1 + + 0 + + + IBCocoaTouchFramework + + 5 + + + IBCocoaTouchFramework + + + + IBCocoaTouchFramework + + 5 + + + IBCocoaTouchFramework + 32 + + + + IBCocoaTouchFramework + + 5 + + + IBCocoaTouchFramework + 32 + + + + IBCocoaTouchFramework + + 5 + + + IBCocoaTouchFramework + 32 + + + + IBCocoaTouchFramework + + 5 + + + + + + 270 + {{5, 230}, {418, 21}} + + + + 4 + MC42NjY2NjY2OSAwAA + + NO + YES + NO + IBCocoaTouchFramework + Loading... + + Helvetica + 13 + 16 + + + 3 + MQA + + + 1 + NO + 10 + + + + -2147483383 + {{454, 231}, {20, 20}} + + NO + NO + NO + IBCocoaTouchFramework + + + {{0, 20}, {480, 300}} + + + 3 + MC41AA + + 2 + + + + + 3 + + IBCocoaTouchFramework + + + + + YES + + + webView + + + + 17 + + + + addressLabel + + + + 18 + + + + backBtn + + + + 19 + + + + fwdBtn + + + + 22 + + + + refreshBtn + + + + 23 + + + + onDoneButtonPress: + + + + 26 + + + + reload + + + + 27 + + + + goBack + + + + 28 + + + + goForward + + + + 29 + + + + onSafariButtonPress: + + + + 31 + + + + view + + + + 35 + + + + spinner + + + + 36 + + + + safariBtn + + + + 40 + + + + + YES + + 0 + + + + + + 1 + + + YES + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + + + 6 + + + YES + + + + + + + + + + + + + + + 7 + + + + + 8 + + + Bar Button Item (Reload) + + + 9 + + + Bar Button Item (Go Back) + + + 10 + + + Bar Button Item (Go Forward) + + + 11 + + + Bar Button Item (Safari) + + + 13 + + + + + 14 + + + + + 15 + + + + + 32 + + + + + 37 + + + + + 38 + + + + + 39 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 10.IBPluginDependency + 11.IBPluginDependency + 13.IBPluginDependency + 13.IBViewBoundsToFrameTransform + 14.IBPluginDependency + 15.IBPluginDependency + 32.IBPluginDependency + 32.IBViewBoundsToFrameTransform + 37.IBPluginDependency + 38.IBPluginDependency + 39.IBPluginDependency + 4.IBPluginDependency + 4.IBViewBoundsToFrameTransform + 6.IBPluginDependency + 6.IBViewBoundsToFrameTransform + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + ChildBrowserViewController + UIResponder + {{250, 643}, {480, 320}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + P4AAAL+AAABCoAAAwygAAA + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + P4AAAL+AAABD5gAAw3kAAA + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + P4AAAL+AAABB8AAAwwUAAA + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + P4AAAL+AAAAAAAAAw10AAA + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 40 + + + + YES + + ChildBrowserViewController + UIViewController + + YES + + YES + onDoneButtonPress: + onSafariButtonPress: + + + YES + id + id + + + + YES + + YES + onDoneButtonPress: + onSafariButtonPress: + + + YES + + onDoneButtonPress: + id + + + onSafariButtonPress: + id + + + + + YES + + YES + addressLabel + backBtn + closeBtn + delegate + fwdBtn + refreshBtn + safariBtn + spinner + webView + + + YES + UILabel + UIBarButtonItem + UIBarButtonItem + id + UIBarButtonItem + UIBarButtonItem + UIBarButtonItem + UIActivityIndicatorView + UIWebView + + + + YES + + YES + addressLabel + backBtn + closeBtn + delegate + fwdBtn + refreshBtn + safariBtn + spinner + webView + + + YES + + addressLabel + UILabel + + + backBtn + UIBarButtonItem + + + closeBtn + UIBarButtonItem + + + delegate + id + + + fwdBtn + UIBarButtonItem + + + refreshBtn + UIBarButtonItem + + + safariBtn + UIBarButtonItem + + + spinner + UIActivityIndicatorView + + + webView + UIWebView + + + + + IBProjectSource + Plugins/ChildBrowser/ChildBrowserViewController.h + + + + + YES + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CAAnimation.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CALayer.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIAccessibility.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UINibLoading.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + + + + UIActivityIndicatorView + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIActivityIndicatorView.h + + + + UIBarButtonItem + UIBarItem + + IBFrameworkSource + UIKit.framework/Headers/UIBarButtonItem.h + + + + UIBarItem + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIBarItem.h + + + + UILabel + UIView + + IBFrameworkSource + UIKit.framework/Headers/UILabel.h + + + + UIResponder + NSObject + + + + UISearchBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UISearchBar.h + + + + UISearchDisplayController + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UISearchDisplayController.h + + + + UIToolbar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIToolbar.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIPrintFormatter.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UITextField.h + + + + UIView + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIView.h + + + + UIViewController + + IBFrameworkSource + MediaPlayer.framework/Headers/MPMoviePlayerViewController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UINavigationController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UIPopoverController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UISplitViewController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITabBarController.h + + + + UIViewController + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIViewController.h + + + + UIWebView + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIWebView.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + + 3 + 141 + + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/.gitignore ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/.gitignore b/spec/plugins/cordova.echo/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/spec/plugins/cordova.echo/.gitignore @@ -0,0 +1 @@ +.DS_Store http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/plugin.xml ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/plugin.xml b/spec/plugins/cordova.echo/plugin.xml new file mode 100644 index 0000000..8468ec1 --- /dev/null +++ b/spec/plugins/cordova.echo/plugin.xml @@ -0,0 +1,24 @@ + + + + + + + + cordova echo + + + + + + + + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/src/blackberry/client.js ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/src/blackberry/client.js b/spec/plugins/cordova.echo/src/blackberry/client.js new file mode 100644 index 0000000..4e7a1b3 --- /dev/null +++ b/spec/plugins/cordova.echo/src/blackberry/client.js @@ -0,0 +1,53 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var _self = {}, + _ID = require("./manifest.json").namespace, + win = null, + fail = null; + +function handleCallback(result) { + if (result) { + if(win){ + win(result); + } + } else { + if(fail){ + fail(result); + } + } + win = null; + fail = null; +} + +_self.doEcho = function (args, theWin, theFail) { + var data = { "message" : args.message || "" }; + + win = theWin; + fail = theFail; + + window.webworks.event.add(_ID, "echoCallback", handleCallback); + + return window.webworks.execSync(_ID, "doEcho", data); +}; + + +module.exports = _self; http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/src/blackberry/device/echoJnext.so ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/src/blackberry/device/echoJnext.so b/spec/plugins/cordova.echo/src/blackberry/device/echoJnext.so new file mode 100755 index 0000000..169714a Binary files /dev/null and b/spec/plugins/cordova.echo/src/blackberry/device/echoJnext.so differ http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/src/blackberry/index.js ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/src/blackberry/index.js b/spec/plugins/cordova.echo/src/blackberry/index.js new file mode 100644 index 0000000..0759a20 --- /dev/null +++ b/spec/plugins/cordova.echo/src/blackberry/index.js @@ -0,0 +1,85 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var echoJNext, + _event = require("../../lib/event"), + winCallback = null, + failCallback = null; + +module.exports = { + doEcho: function (success, fail, args) { + var invokeData = { "message" : JSON.parse(decodeURIComponent(args.message)) }; + try { + success(echoJNext.getEchoJNext(invokeData)); + } catch (e) { + fail(-1, e); + } + } +}; + +/////////////////////////////////////////////////////////////////// +// JavaScript wrapper for JNEXT plugin +/////////////////////////////////////////////////////////////////// + +JNEXT.EchoJNext = function () +{ + var _self = this; + + _self.getEchoJNext = function (args) { + return JNEXT.invoke(_self._id, "doEcho " + JSON.stringify(args)); + }; + + _self.getId = function () { + return _self._id; + }; + + _self.init = function () { + if (!JNEXT.require("echoJnext")) { + return false; + } + + _self._id = JNEXT.createObject("echoJnext.Echo"); + + if (!_self._id || _self._id === "") { + return false; + } + + JNEXT.registerEvents(_self); + }; + + _self.onEvent = function (strData) { + var arData = strData.split(" "), + strEventId = arData[0], + args = arData[1], + info = {}; + + if (strEventId === "cordova.echo.callback") { + _event.trigger("echoCallback", args); + } + + }; + + _self._id = ""; + + _self.init(); +}; + +echoJNext = new JNEXT.EchoJNext(); http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/src/blackberry/manifest.json ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/src/blackberry/manifest.json b/spec/plugins/cordova.echo/src/blackberry/manifest.json new file mode 100644 index 0000000..d14e79e --- /dev/null +++ b/spec/plugins/cordova.echo/src/blackberry/manifest.json @@ -0,0 +1,5 @@ +{ + "global": false, + "namespace": "cordova.echo", + "dependencies": [] +} http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/src/blackberry/public/json/autolink.h ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/src/blackberry/public/json/autolink.h b/spec/plugins/cordova.echo/src/blackberry/public/json/autolink.h new file mode 100644 index 0000000..37c9258 --- /dev/null +++ b/spec/plugins/cordova.echo/src/blackberry/public/json/autolink.h @@ -0,0 +1,19 @@ +#ifndef JSON_AUTOLINK_H_INCLUDED +# define JSON_AUTOLINK_H_INCLUDED + +# include "config.h" + +# ifdef JSON_IN_CPPTL +# include +# endif + +# if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && !defined(JSON_IN_CPPTL) +# define CPPTL_AUTOLINK_NAME "json" +# undef CPPTL_AUTOLINK_DLL +# ifdef JSON_DLL +# define CPPTL_AUTOLINK_DLL +# endif +# include "autolink.h" +# endif + +#endif // JSON_AUTOLINK_H_INCLUDED http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/src/blackberry/public/json/config.h ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/src/blackberry/public/json/config.h b/spec/plugins/cordova.echo/src/blackberry/public/json/config.h new file mode 100644 index 0000000..5d334cb --- /dev/null +++ b/spec/plugins/cordova.echo/src/blackberry/public/json/config.h @@ -0,0 +1,43 @@ +#ifndef JSON_CONFIG_H_INCLUDED +# define JSON_CONFIG_H_INCLUDED + +/// If defined, indicates that json library is embedded in CppTL library. +//# define JSON_IN_CPPTL 1 + +/// If defined, indicates that json may leverage CppTL library +//# define JSON_USE_CPPTL 1 +/// If defined, indicates that cpptl vector based map should be used instead of std::map +/// as Value container. +//# define JSON_USE_CPPTL_SMALLMAP 1 +/// If defined, indicates that Json specific container should be used +/// (hash table & simple deque container with customizable allocator). +/// THIS FEATURE IS STILL EXPERIMENTAL! +//# define JSON_VALUE_USE_INTERNAL_MAP 1 +/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. +/// The memory pools allocator used optimization (initializing Value and ValueInternalLink +/// as if it was a POD) that may cause some validation tool to report errors. +/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. +//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 + +/// If defined, indicates that Json use exception to report invalid type manipulation +/// instead of C assert macro. +# define JSON_USE_EXCEPTION 1 + +# ifdef JSON_IN_CPPTL +# include +# ifndef JSON_USE_CPPTL +# define JSON_USE_CPPTL 1 +# endif +# endif + +# ifdef JSON_IN_CPPTL +# define JSON_API CPPTL_API +# elif defined(JSON_DLL_BUILD) +# define JSON_API __declspec(dllexport) +# elif defined(JSON_DLL) +# define JSON_API __declspec(dllimport) +# else +# define JSON_API +# endif + +#endif // JSON_CONFIG_H_INCLUDED http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/src/blackberry/public/json/features.h ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/src/blackberry/public/json/features.h b/spec/plugins/cordova.echo/src/blackberry/public/json/features.h new file mode 100644 index 0000000..5a9adec --- /dev/null +++ b/spec/plugins/cordova.echo/src/blackberry/public/json/features.h @@ -0,0 +1,42 @@ +#ifndef CPPTL_JSON_FEATURES_H_INCLUDED +# define CPPTL_JSON_FEATURES_H_INCLUDED + +# include "forwards.h" + +namespace Json { + + /** \brief Configuration passed to reader and writer. + * This configuration object can be used to force the Reader or Writer + * to behave in a standard conforming way. + */ + class JSON_API Features + { + public: + /** \brief A configuration that allows all features and assumes all strings are UTF-8. + * - C & C++ comments are allowed + * - Root object can be any JSON value + * - Assumes Value strings are encoded in UTF-8 + */ + static Features all(); + + /** \brief A configuration that is strictly compatible with the JSON specification. + * - Comments are forbidden. + * - Root object must be either an array or an object value. + * - Assumes Value strings are encoded in UTF-8 + */ + static Features strictMode(); + + /** \brief Initialize the configuration like JsonConfig::allFeatures; + */ + Features(); + + /// \c true if comments are allowed. Default: \c true. + bool allowComments_; + + /// \c true if root must be either an array or an object value. Default: \c false. + bool strictRoot_; + }; + +} // namespace Json + +#endif // CPPTL_JSON_FEATURES_H_INCLUDED http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/src/blackberry/public/json/forwards.h ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/src/blackberry/public/json/forwards.h b/spec/plugins/cordova.echo/src/blackberry/public/json/forwards.h new file mode 100644 index 0000000..d0ce830 --- /dev/null +++ b/spec/plugins/cordova.echo/src/blackberry/public/json/forwards.h @@ -0,0 +1,39 @@ +#ifndef JSON_FORWARDS_H_INCLUDED +# define JSON_FORWARDS_H_INCLUDED + +# include "config.h" + +namespace Json { + + // writer.h + class FastWriter; + class StyledWriter; + + // reader.h + class Reader; + + // features.h + class Features; + + // value.h + typedef int Int; + typedef unsigned int UInt; + class StaticString; + class Path; + class PathArgument; + class Value; + class ValueIteratorBase; + class ValueIterator; + class ValueConstIterator; +#ifdef JSON_VALUE_USE_INTERNAL_MAP + class ValueAllocator; + class ValueMapAllocator; + class ValueInternalLink; + class ValueInternalArray; + class ValueInternalMap; +#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP + +} // namespace Json + + +#endif // JSON_FORWARDS_H_INCLUDED http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/src/blackberry/public/json/json.h ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/src/blackberry/public/json/json.h b/spec/plugins/cordova.echo/src/blackberry/public/json/json.h new file mode 100644 index 0000000..c71ed65 --- /dev/null +++ b/spec/plugins/cordova.echo/src/blackberry/public/json/json.h @@ -0,0 +1,10 @@ +#ifndef JSON_JSON_H_INCLUDED +# define JSON_JSON_H_INCLUDED + +# include "autolink.h" +# include "value.h" +# include "reader.h" +# include "writer.h" +# include "features.h" + +#endif // JSON_JSON_H_INCLUDED http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/cordova.echo/src/blackberry/public/json/reader.h ---------------------------------------------------------------------- diff --git a/spec/plugins/cordova.echo/src/blackberry/public/json/reader.h b/spec/plugins/cordova.echo/src/blackberry/public/json/reader.h new file mode 100644 index 0000000..ee1d6a2 --- /dev/null +++ b/spec/plugins/cordova.echo/src/blackberry/public/json/reader.h @@ -0,0 +1,196 @@ +#ifndef CPPTL_JSON_READER_H_INCLUDED +# define CPPTL_JSON_READER_H_INCLUDED + +# include "features.h" +# include "value.h" +# include +# include +# include +# include + +namespace Json { + + /** \brief Unserialize a JSON document into a Value. + * + */ + class JSON_API Reader + { + public: + typedef char Char; + typedef const Char *Location; + + /** \brief Constructs a Reader allowing all features + * for parsing. + */ + Reader(); + + /** \brief Constructs a Reader allowing the specified feature set + * for parsing. + */ + Reader( const Features &features ); + + /** \brief Read a Value from a JSON document. + * \param document UTF-8 encoded string containing the document to read. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them back during + * serialization, \c false to discard comments. + * This parameter is ignored if Features::allowComments_ + * is \c false. + * \return \c true if the document was successfully parsed, \c false if an error occurred. + */ + bool parse( const std::string &document, + Value &root, + bool collectComments = true ); + + /** \brief Read a Value from a JSON document. + * \param document UTF-8 encoded string containing the document to read. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them back during + * serialization, \c false to discard comments. + * This parameter is ignored if Features::allowComments_ + * is \c false. + * \return \c true if the document was successfully parsed, \c false if an error occurred. + */ + bool parse( const char *beginDoc, const char *endDoc, + Value &root, + bool collectComments = true ); + + /// \brief Parse from input stream. + /// \see Json::operator>>(std::istream&, Json::Value&). + bool parse( std::istream &is, + Value &root, + bool collectComments = true ); + + /** \brief Returns a user friendly string that list errors in the parsed document. + * \return Formatted error message with the list of errors with their location in + * the parsed document. An empty string is returned if no error occurred + * during parsing. + */ + std::string getFormatedErrorMessages() const; + + private: + enum TokenType + { + tokenEndOfStream = 0, + tokenObjectBegin, + tokenObjectEnd, + tokenArrayBegin, + tokenArrayEnd, + tokenString, + tokenNumber, + tokenTrue, + tokenFalse, + tokenNull, + tokenArraySeparator, + tokenMemberSeparator, + tokenComment, + tokenError + }; + + class Token + { + public: + TokenType type_; + Location start_; + Location end_; + }; + + class ErrorInfo + { + public: + Token token_; + std::string message_; + Location extra_; + }; + + typedef std::deque Errors; + + bool expectToken( TokenType type, Token &token, const char *message ); + bool readToken( Token &token ); + void skipSpaces(); + bool match( Location pattern, + int patternLength ); + bool readComment(); + bool readCStyleComment(); + bool readCppStyleComment(); + bool readString(); + void readNumber(); + bool readValue(); + bool readObject( Token &token ); + bool readArray( Token &token ); + bool decodeNumber( Token &token ); + bool decodeString( Token &token ); + bool decodeString( Token &token, std::string &decoded ); + bool decodeDouble( Token &token ); + bool decodeUnicodeCodePoint( Token &token, + Location ¤t, + Location end, + unsigned int &unicode ); + bool decodeUnicodeEscapeSequence( Token &token, + Location ¤t, + Location end, + unsigned int &unicode ); + bool addError( const std::string &message, + Token &token, + Location extra = 0 ); + bool recoverFromError( TokenType skipUntilToken ); + bool addErrorAndRecover( const std::string &message, + Token &token, + TokenType skipUntilToken ); + void skipUntilSpace(); + Value ¤tValue(); + Char getNextChar(); + void getLocationLineAndColumn( Location location, + int &line, + int &column ) const; + std::string getLocationLineAndColumn( Location location ) const; + void addComment( Location begin, + Location end, + CommentPlacement placement ); + void skipCommentTokens( Token &token ); + + typedef std::stack Nodes; + Nodes nodes_; + Errors errors_; + std::string document_; + Location begin_; + Location end_; + Location current_; + Location lastValueEnd_; + Value *lastValue_; + std::string commentsBefore_; + Features features_; + bool collectComments_; + }; + + /** \brief Read from 'sin' into 'root'. + + Always keep comments from the input JSON. + + This can be used to read a file into a particular sub-object. + For example: + \code + Json::Value root; + cin >> root["dir"]["file"]; + cout << root; + \endcode + Result: + \verbatim + { + "dir": { + "file": { + // The input stream JSON would be nested here. + } + } + } + \endverbatim + \throw std::exception on parse error. + \see Json::operator<<() + */ + std::istream& operator>>( std::istream&, Value& ); + +} // namespace Json + +#endif // CPPTL_JSON_READER_H_INCLUDED