//////////////////////////////////////////////////////////////////////////////// /// @brief V8 utility functions /// /// @file /// /// DISCLAIMER /// /// Copyright 2004-2013 triAGENS GmbH, Cologne, Germany /// /// Licensed 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. /// /// Copyright holder is triAGENS GmbH, Cologne, Germany /// /// @author Dr. Frank Celler /// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// #ifndef TRIAGENS_V8_V8_CONV_H #define TRIAGENS_V8_V8_CONV_H 1 #include "V8/v8-globals.h" #include "BasicsC/json.h" #include "ShapedJson/json-shaper.h" // ----------------------------------------------------------------------------- // --SECTION-- CONVERSION FUNCTIONS // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // --SECTION-- public functions // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief pushes the names of an associative char* array into a V8 array //////////////////////////////////////////////////////////////////////////////// v8::Handle TRI_ArrayAssociativePointer (const TRI_associative_pointer_t* const); //////////////////////////////////////////////////////////////////////////////// /// @brief converts a TRI_json_t into a V8 object //////////////////////////////////////////////////////////////////////////////// v8::Handle TRI_ObjectJson (TRI_json_t const*); //////////////////////////////////////////////////////////////////////////////// /// @brief converts a TRI_shaped_json_t into a V8 object //////////////////////////////////////////////////////////////////////////////// v8::Handle TRI_JsonShapeData (TRI_shaper_t*, TRI_shape_t const*, char const* data, size_t size); //////////////////////////////////////////////////////////////////////////////// /// @brief converts an V8 object to a TRI_shaped_json_t //////////////////////////////////////////////////////////////////////////////// TRI_shaped_json_t* TRI_ShapedJsonV8Object (v8::Handle, TRI_shaper_t*); //////////////////////////////////////////////////////////////////////////////// /// @brief converts a V8 object to a TRI_shaped_json_t in place //////////////////////////////////////////////////////////////////////////////// int TRI_FillShapedJsonV8Object (v8::Handle object, TRI_shaped_json_t* result, TRI_shaper_t*); //////////////////////////////////////////////////////////////////////////////// /// @brief convert a V8 value to a json_t value //////////////////////////////////////////////////////////////////////////////// TRI_json_t* TRI_ObjectToJson (v8::Handle); //////////////////////////////////////////////////////////////////////////////// /// @brief converts an V8 object to a string //////////////////////////////////////////////////////////////////////////////// std::string TRI_ObjectToString (v8::Handle); //////////////////////////////////////////////////////////////////////////////// /// @brief converts an V8 object to a character //////////////////////////////////////////////////////////////////////////////// char TRI_ObjectToCharacter (v8::Handle, bool& error); //////////////////////////////////////////////////////////////////////////////// /// @brief converts an V8 object to an int64_t //////////////////////////////////////////////////////////////////////////////// int64_t TRI_ObjectToInt64 (v8::Handle); //////////////////////////////////////////////////////////////////////////////// /// @brief converts an V8 object to a uint64_t //////////////////////////////////////////////////////////////////////////////// uint64_t TRI_ObjectToUInt64 (v8::Handle, const bool); //////////////////////////////////////////////////////////////////////////////// /// @brief converts a V8 object to a double //////////////////////////////////////////////////////////////////////////////// double TRI_ObjectToDouble (v8::Handle); //////////////////////////////////////////////////////////////////////////////// /// @brief converts a V8 object to a double with error handling //////////////////////////////////////////////////////////////////////////////// double TRI_ObjectToDouble (v8::Handle, bool& error); //////////////////////////////////////////////////////////////////////////////// /// @brief converts a V8 object to a boolean //////////////////////////////////////////////////////////////////////////////// bool TRI_ObjectToBoolean (v8::Handle); // ----------------------------------------------------------------------------- // --SECTION-- GENERAL // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // --SECTION-- public functions // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief initialises the V8 conversion module //////////////////////////////////////////////////////////////////////////////// void TRI_InitV8Conversions (v8::Handle); #endif // ----------------------------------------------------------------------------- // --SECTION-- END-OF-FILE // ----------------------------------------------------------------------------- // Local Variables: // mode: outline-minor // outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}" // End: