1
0
Fork 0
This commit is contained in:
Frank Celler 2012-02-03 18:29:10 +01:00
parent 2c4a01989c
commit 38900e755e
9 changed files with 1659 additions and 1536 deletions

View File

@ -129,6 +129,7 @@ libavocadodb_a_SOURCES = \
V8/v8-json.cpp \
V8/v8-shell.cpp \
V8/v8-utils.cpp \
V8/v8-conv.cpp \
V8/v8-line-editor.cpp \
V8/v8-vocbase.cpp \
Variant/VariantArray.cpp \

View File

@ -27,8 +27,6 @@
#include "v8-actions.h"
#include <map>
#include "Basics/ReadLocker.h"
#include "Basics/WriteLocker.h"
#include "BasicsC/conversions.h"
@ -36,6 +34,7 @@
#include "Rest/HttpRequest.h"
#include "Rest/HttpResponse.h"
#include "V8/v8-conv.h"
#include "V8/v8-utils.h"
#include "V8/v8-vocbase.h"

1502
V8/v8-conv.cpp Normal file

File diff suppressed because it is too large Load Diff

147
V8/v8-conv.h Normal file
View File

@ -0,0 +1,147 @@
////////////////////////////////////////////////////////////////////////////////
/// @brief V8 utility functions
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2004-2012 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-2012, 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 "VocBase/simple-collection.h"
#include "V8/v8-c-utils.h"
// -----------------------------------------------------------------------------
// --SECTION-- CONVERSION FUNCTIONS
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// --SECTION-- public functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup V8Conversions
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief converts a TRI_json_t into a V8 object
////////////////////////////////////////////////////////////////////////////////
v8::Handle<v8::Value> TRI_ObjectJson (TRI_json_t const*);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts a TRI_shaped_json_t into a V8 object
////////////////////////////////////////////////////////////////////////////////
v8::Handle<v8::Value> TRI_ObjectRSEntry (TRI_doc_collection_t* collection,
TRI_shaper_t* shaper,
TRI_rs_entry_t const* entry);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts a TRI_result_set_t into a V8 array
////////////////////////////////////////////////////////////////////////////////
v8::Handle<v8::Array> TRI_ArrayResultSet (TRI_result_set_t* rs);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a TRI_shaped_json_t
////////////////////////////////////////////////////////////////////////////////
TRI_shaped_json_t* TRI_ShapedJsonV8Object (v8::Handle<v8::Value> object, TRI_shaper_t*);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a string
////////////////////////////////////////////////////////////////////////////////
std::string TRI_ObjectToString (v8::Handle<v8::Value> value);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a character
////////////////////////////////////////////////////////////////////////////////
char TRI_ObjectToCharacter (v8::Handle<v8::Value> value, bool& error);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a double
////////////////////////////////////////////////////////////////////////////////
double TRI_ObjectToDouble (v8::Handle<v8::Value> value);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a double
////////////////////////////////////////////////////////////////////////////////
double TRI_ObjectToDouble (v8::Handle<v8::Value> value, bool& error);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a boolean
////////////////////////////////////////////////////////////////////////////////
bool TRI_ObjectToBoolean (v8::Handle<v8::Value> value);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts a TRI_shaped_json_t into a V8 object
////////////////////////////////////////////////////////////////////////////////
v8::Handle<v8::Value> TRI_JsonShapeData (TRI_shaper_t* shaper,
TRI_shape_t const* shape,
char const* data,
size_t size);
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- GENERAL
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// --SECTION-- public functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup V8Conversions
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief initialises the V8 conversion module
////////////////////////////////////////////////////////////////////////////////
void TRI_InitV8Conversions (v8::Handle<v8::Context> context, std::string const& path);
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
#endif
// Local Variables:
// mode: outline-minor
// outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)"
// End:

View File

@ -32,11 +32,11 @@
#include "BasicsC/logging.h"
#include "BasicsC/string-buffer.h"
#include "BasicsC/strings.h"
#include "ShapedJson/shaped-json.h"
#include <fstream>
#include "V8/v8-conv.h"
#include "V8/v8-json.h"
#include "V8/v8-utils.h"

File diff suppressed because it is too large Load Diff

View File

@ -31,95 +31,8 @@
#include "V8/v8-globals.h"
#include "BasicsC/json.h"
#include "VocBase/simple-collection.h"
#include "V8/v8-c-utils.h"
// -----------------------------------------------------------------------------
// --SECTION-- CONVERSION FUNCTIONS
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// --SECTION-- public functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup V8Utils
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief converts a TRI_json_t into a V8 object
////////////////////////////////////////////////////////////////////////////////
v8::Handle<v8::Value> TRI_ObjectJson (TRI_json_t const*);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts a TRI_shaped_json_t into a V8 object
////////////////////////////////////////////////////////////////////////////////
v8::Handle<v8::Value> TRI_ObjectRSEntry (TRI_doc_collection_t* collection,
TRI_shaper_t* shaper,
TRI_rs_entry_t const* entry);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts a TRI_result_set_t into a V8 array
////////////////////////////////////////////////////////////////////////////////
v8::Handle<v8::Array> TRI_ArrayResultSet (TRI_result_set_t* rs);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a TRI_shaped_json_t
////////////////////////////////////////////////////////////////////////////////
TRI_shaped_json_t* TRI_ShapedJsonV8Object (v8::Handle<v8::Value> object, TRI_shaper_t*);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a string
////////////////////////////////////////////////////////////////////////////////
std::string TRI_ObjectToString (v8::Handle<v8::Value> value);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a character
////////////////////////////////////////////////////////////////////////////////
char TRI_ObjectToCharacter (v8::Handle<v8::Value> value, bool& error);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a double
////////////////////////////////////////////////////////////////////////////////
double TRI_ObjectToDouble (v8::Handle<v8::Value> value);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a double
////////////////////////////////////////////////////////////////////////////////
double TRI_ObjectToDouble (v8::Handle<v8::Value> value, bool& error);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts an V8 object to a boolean
////////////////////////////////////////////////////////////////////////////////
bool TRI_ObjectToBoolean (v8::Handle<v8::Value> value);
////////////////////////////////////////////////////////////////////////////////
/// @brief converts a TRI_shaped_json_t into a V8 object
////////////////////////////////////////////////////////////////////////////////
v8::Handle<v8::Value> TRI_JsonShapeData (TRI_shaper_t* shaper,
TRI_shape_t const* shape,
char const* data,
size_t size);
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- GENERAL
// -----------------------------------------------------------------------------

View File

@ -32,13 +32,14 @@
#include "BasicsC/csv.h"
#include "BasicsC/logging.h"
#include "BasicsC/strings.h"
#include "ShapedJson/shaped-json.h"
#include "QL/ParserWrapper.h"
#include "ShapedJson/shape-accessor.h"
#include "ShapedJson/shaped-json.h"
#include "V8/v8-conv.h"
#include "V8/v8-utils.h"
#include "VocBase/fluent-query.h"
#include "VocBase/query.h"
#include "VocBase/simple-collection.h"
#include "QL/ParserWrapper.h"
using namespace std;
using namespace triagens::basics;

View File

@ -1 +1 @@
#define TRIAGENS_VERSION "0.0.8 [1308M]"
#define TRIAGENS_VERSION "0.0.8 [1309M]"