1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
Jan Steemann 2012-09-28 17:06:38 +02:00
commit d185659161
12 changed files with 3970 additions and 3953 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,141 +1,141 @@
static string JS_common_bootstrap_errors =
"/*jslint indent: 2,\n"
" nomen: true,\n"
" maxlen: 240,\n"
" sloppy: true,\n"
" vars: true,\n"
" white: true,\n"
" plusplus: true */\n"
"/*global require */\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief auto-generated file generated from errors.dat\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
"(function () {\n"
" var internal = require(\"internal\");\n"
"\n"
" internal.errors = {\n"
" \"ERROR_NO_ERROR\" : { \"code\" : 0, \"message\" : \"no error\" }, \n"
" \"ERROR_FAILED\" : { \"code\" : 1, \"message\" : \"failed\" }, \n"
" \"ERROR_SYS_ERROR\" : { \"code\" : 2, \"message\" : \"system error\" }, \n"
" \"ERROR_OUT_OF_MEMORY\" : { \"code\" : 3, \"message\" : \"out of memory\" }, \n"
" \"ERROR_INTERNAL\" : { \"code\" : 4, \"message\" : \"internal error\" }, \n"
" \"ERROR_ILLEGAL_NUMBER\" : { \"code\" : 5, \"message\" : \"illegal number\" }, \n"
" \"ERROR_NUMERIC_OVERFLOW\" : { \"code\" : 6, \"message\" : \"numeric overflow\" }, \n"
" \"ERROR_ILLEGAL_OPTION\" : { \"code\" : 7, \"message\" : \"illegal option\" }, \n"
" \"ERROR_DEAD_PID\" : { \"code\" : 8, \"message\" : \"dead process identifier\" }, \n"
" \"ERROR_NOT_IMPLEMENTED\" : { \"code\" : 9, \"message\" : \"not implemented\" }, \n"
" \"ERROR_BAD_PARAMETER\" : { \"code\" : 10, \"message\" : \"bad parameter\" }, \n"
" \"ERROR_FORBIDDEN\" : { \"code\" : 11, \"message\" : \"forbidden\" }, \n"
" \"ERROR_OUT_OF_MEMORY_MMAP\" : { \"code\" : 12, \"message\" : \"out of memory in mmap\" }, \n"
" \"ERROR_CORRUPTED_CSV\" : { \"code\" : 13, \"message\" : \"csv is corrupt\" }, \n"
" \"ERROR_HTTP_BAD_PARAMETER\" : { \"code\" : 400, \"message\" : \"bad parameter\" }, \n"
" \"ERROR_HTTP_FORBIDDEN\" : { \"code\" : 403, \"message\" : \"forbidden\" }, \n"
" \"ERROR_HTTP_NOT_FOUND\" : { \"code\" : 404, \"message\" : \"not found\" }, \n"
" \"ERROR_HTTP_METHOD_NOT_ALLOWED\" : { \"code\" : 405, \"message\" : \"method not supported\" }, \n"
" \"ERROR_HTTP_SERVER_ERROR\" : { \"code\" : 500, \"message\" : \"internal server error\" }, \n"
" \"ERROR_HTTP_CORRUPTED_JSON\" : { \"code\" : 600, \"message\" : \"invalid JSON object\" }, \n"
" \"ERROR_HTTP_SUPERFLUOUS_SUFFICES\" : { \"code\" : 601, \"message\" : \"superfluous URL suffices\" }, \n"
" \"ERROR_ARANGO_ILLEGAL_STATE\" : { \"code\" : 1000, \"message\" : \"illegal state\" }, \n"
" \"ERROR_ARANGO_SHAPER_FAILED\" : { \"code\" : 1001, \"message\" : \"illegal shaper\" }, \n"
" \"ERROR_ARANGO_DATAFILE_SEALED\" : { \"code\" : 1002, \"message\" : \"datafile sealed\" }, \n"
" \"ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE\" : { \"code\" : 1003, \"message\" : \"unknown type\" }, \n"
" \"ERROR_ARANGO_READ_ONLY\" : { \"code\" : 1004, \"message\" : \"ready only\" }, \n"
" \"ERROR_ARANGO_DUPLICATE_IDENTIFIER\" : { \"code\" : 1005, \"message\" : \"duplicate identifier\" }, \n"
" \"ERROR_ARANGO_DATAFILE_UNREADABLE\" : { \"code\" : 1006, \"message\" : \"datafile unreadable\" }, \n"
" \"ERROR_ARANGO_CORRUPTED_DATAFILE\" : { \"code\" : 1100, \"message\" : \"corrupted datafile\" }, \n"
" \"ERROR_ARANGO_ILLEGAL_PARAMETER_FILE\" : { \"code\" : 1101, \"message\" : \"illegal parameter file\" }, \n"
" \"ERROR_ARANGO_CORRUPTED_COLLECTION\" : { \"code\" : 1102, \"message\" : \"corrupted collection\" }, \n"
" \"ERROR_ARANGO_MMAP_FAILED\" : { \"code\" : 1103, \"message\" : \"mmap failed\" }, \n"
" \"ERROR_ARANGO_FILESYSTEM_FULL\" : { \"code\" : 1104, \"message\" : \"filesystem full\" }, \n"
" \"ERROR_ARANGO_NO_JOURNAL\" : { \"code\" : 1105, \"message\" : \"no journal\" }, \n"
" \"ERROR_ARANGO_DATAFILE_ALREADY_EXISTS\" : { \"code\" : 1106, \"message\" : \"cannot create/rename datafile because it already exists\" }, \n"
" \"ERROR_ARANGO_DATABASE_LOCKED\" : { \"code\" : 1107, \"message\" : \"database is locked\" }, \n"
" \"ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS\" : { \"code\" : 1108, \"message\" : \"cannot create/rename collection because directory already exists\" }, \n"
" \"ERROR_ARANGO_CONFLICT\" : { \"code\" : 1200, \"message\" : \"conflict\" }, \n"
" \"ERROR_ARANGO_WRONG_VOCBASE_PATH\" : { \"code\" : 1201, \"message\" : \"wrong path for database\" }, \n"
" \"ERROR_ARANGO_DOCUMENT_NOT_FOUND\" : { \"code\" : 1202, \"message\" : \"document not found\" }, \n"
" \"ERROR_ARANGO_COLLECTION_NOT_FOUND\" : { \"code\" : 1203, \"message\" : \"collection not found\" }, \n"
" \"ERROR_ARANGO_COLLECTION_PARAMETER_MISSING\" : { \"code\" : 1204, \"message\" : \"parameter 'collection' not found\" }, \n"
" \"ERROR_ARANGO_DOCUMENT_HANDLE_BAD\" : { \"code\" : 1205, \"message\" : \"illegal document handle\" }, \n"
" \"ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL\" : { \"code\" : 1206, \"message\" : \"maixaml size of journal too small\" }, \n"
" \"ERROR_ARANGO_DUPLICATE_NAME\" : { \"code\" : 1207, \"message\" : \"duplicate name\" }, \n"
" \"ERROR_ARANGO_ILLEGAL_NAME\" : { \"code\" : 1208, \"message\" : \"illegal name\" }, \n"
" \"ERROR_ARANGO_NO_INDEX\" : { \"code\" : 1209, \"message\" : \"no suitable index known\" }, \n"
" \"ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED\" : { \"code\" : 1210, \"message\" : \"unique constraint violated\" }, \n"
" \"ERROR_ARANGO_GEO_INDEX_VIOLATED\" : { \"code\" : 1211, \"message\" : \"geo index violated\" }, \n"
" \"ERROR_ARANGO_INDEX_NOT_FOUND\" : { \"code\" : 1212, \"message\" : \"index not found\" }, \n"
" \"ERROR_ARANGO_CROSS_COLLECTION_REQUEST\" : { \"code\" : 1213, \"message\" : \"cross collection request not allowed\" }, \n"
" \"ERROR_ARANGO_INDEX_HANDLE_BAD\" : { \"code\" : 1214, \"message\" : \"illegal index handle\" }, \n"
" \"ERROR_ARANGO_CAP_CONSTRAINT_ALREADY_DEFINED\" : { \"code\" : 1215, \"message\" : \"cap constraint already defined\" }, \n"
" \"ERROR_ARANGO_DOCUMENT_TOO_LARGE\" : { \"code\" : 1216, \"message\" : \"document too large\" }, \n"
" \"ERROR_ARANGO_COLLECTION_NOT_UNLOADED\" : { \"code\" : 1217, \"message\" : \"collection must be unloaded\" }, \n"
" \"ERROR_ARANGO_COLLECTION_TYPE_INVALID\" : { \"code\" : 1218, \"message\" : \"collection type invalid\" }, \n"
" \"ERROR_ARANGO_DATAFILE_FULL\" : { \"code\" : 1300, \"message\" : \"datafile full\" }, \n"
" \"ERROR_QUERY_KILLED\" : { \"code\" : 1500, \"message\" : \"query killed\" }, \n"
" \"ERROR_QUERY_PARSE\" : { \"code\" : 1501, \"message\" : \"%s\" }, \n"
" \"ERROR_QUERY_EMPTY\" : { \"code\" : 1502, \"message\" : \"query is empty\" }, \n"
" \"ERROR_QUERY_SCRIPT\" : { \"code\" : 1503, \"message\" : \"runtime error '%s'\" }, \n"
" \"ERROR_QUERY_NUMBER_OUT_OF_RANGE\" : { \"code\" : 1504, \"message\" : \"number out of range\" }, \n"
" \"ERROR_QUERY_VARIABLE_NAME_INVALID\" : { \"code\" : 1510, \"message\" : \"variable name '%s' has an invalid format\" }, \n"
" \"ERROR_QUERY_VARIABLE_REDECLARED\" : { \"code\" : 1511, \"message\" : \"variable '%s' is assigned multiple times\" }, \n"
" \"ERROR_QUERY_VARIABLE_NAME_UNKNOWN\" : { \"code\" : 1512, \"message\" : \"unknown variable '%s'\" }, \n"
" \"ERROR_QUERY_COLLECTION_NOT_FOUND\" : { \"code\" : 1520, \"message\" : \"unable to open collection '%s'\" }, \n"
" \"ERROR_QUERY_COLLECTION_LOCK_FAILED\" : { \"code\" : 1521, \"message\" : \"unable to read-lock collection %s\" }, \n"
" \"ERROR_QUERY_TOO_MANY_COLLECTIONS\" : { \"code\" : 1522, \"message\" : \"too many collections\" }, \n"
" \"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED\" : { \"code\" : 1530, \"message\" : \"document attribute '%s' is assigned multiple times\" }, \n"
" \"ERROR_QUERY_FUNCTION_NAME_UNKNOWN\" : { \"code\" : 1540, \"message\" : \"usage of unknown function '%s'\" }, \n"
" \"ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH\" : { \"code\" : 1541, \"message\" : \"invalid number of arguments for function '%s'\" }, \n"
" \"ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH\" : { \"code\" : 1542, \"message\" : \"invalid argument type used in call to function '%s()'\" }, \n"
" \"ERROR_QUERY_BIND_PARAMETERS_INVALID\" : { \"code\" : 1550, \"message\" : \"invalid structure of bind parameters\" }, \n"
" \"ERROR_QUERY_BIND_PARAMETER_MISSING\" : { \"code\" : 1551, \"message\" : \"no value specified for declared bind parameter '%s'\" }, \n"
" \"ERROR_QUERY_BIND_PARAMETER_UNDECLARED\" : { \"code\" : 1552, \"message\" : \"bind parameter '%s' was not declared in the query\" }, \n"
" \"ERROR_QUERY_BIND_PARAMETER_TYPE\" : { \"code\" : 1553, \"message\" : \"bind parameter '%s' has an invalid value or type\" }, \n"
" \"ERROR_QUERY_INVALID_LOGICAL_VALUE\" : { \"code\" : 1560, \"message\" : \"invalid logical value\" }, \n"
" \"ERROR_QUERY_INVALID_ARITHMETIC_VALUE\" : { \"code\" : 1561, \"message\" : \"invalid arithmetic value\" }, \n"
" \"ERROR_QUERY_DIVISION_BY_ZERO\" : { \"code\" : 1562, \"message\" : \"division by zero\" }, \n"
" \"ERROR_QUERY_LIST_EXPECTED\" : { \"code\" : 1563, \"message\" : \"list expected\" }, \n"
" \"ERROR_QUERY_FAIL_CALLED\" : { \"code\" : 1569, \"message\" : \"FAIL(%s) called\" }, \n"
" \"ERROR_QUERY_GEO_INDEX_MISSING\" : { \"code\" : 1570, \"message\" : \"no suitable geo index found for geo restriction on '%s'\" }, \n"
" \"ERROR_CURSOR_NOT_FOUND\" : { \"code\" : 1600, \"message\" : \"cursor not found\" }, \n"
" \"ERROR_KEYVALUE_INVALID_KEY\" : { \"code\" : 1800, \"message\" : \"invalid key declaration\" }, \n"
" \"ERROR_KEYVALUE_KEY_EXISTS\" : { \"code\" : 1801, \"message\" : \"key already exists\" }, \n"
" \"ERROR_KEYVALUE_KEY_NOT_FOUND\" : { \"code\" : 1802, \"message\" : \"key not found\" }, \n"
" \"ERROR_KEYVALUE_KEY_NOT_UNIQUE\" : { \"code\" : 1803, \"message\" : \"key is not unique\" }, \n"
" \"ERROR_KEYVALUE_KEY_NOT_CHANGED\" : { \"code\" : 1804, \"message\" : \"key value not changed\" }, \n"
" \"ERROR_KEYVALUE_KEY_NOT_REMOVED\" : { \"code\" : 1805, \"message\" : \"key value not removed\" }, \n"
" \"ERROR_KEYVALUE_NO_VALUE\" : { \"code\" : 1806, \"message\" : \"missing value\" }, \n"
" \"ERROR_GRAPH_INVALID_GRAPH\" : { \"code\" : 1901, \"message\" : \"invalid graph\" }, \n"
" \"ERROR_GRAPH_COULD_NOT_CREATE_GRAPH\" : { \"code\" : 1902, \"message\" : \"could not create graph\" }, \n"
" \"ERROR_GRAPH_INVALID_VERTEX\" : { \"code\" : 1903, \"message\" : \"invalid vertex\" }, \n"
" \"ERROR_GRAPH_COULD_NOT_CREATE_VERTEX\" : { \"code\" : 1904, \"message\" : \"could not create vertex\" }, \n"
" \"ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX\" : { \"code\" : 1905, \"message\" : \"could not change vertex\" }, \n"
" \"ERROR_GRAPH_INVALID_EDGE\" : { \"code\" : 1906, \"message\" : \"invalid edge\" }, \n"
" \"ERROR_GRAPH_COULD_NOT_CREATE_EDGE\" : { \"code\" : 1907, \"message\" : \"could not create edge\" }, \n"
" \"ERROR_GRAPH_COULD_NOT_CHANGE_EDGE\" : { \"code\" : 1908, \"message\" : \"could not change edge\" }, \n"
" \"SIMPLE_CLIENT_UNKNOWN_ERROR\" : { \"code\" : 2000, \"message\" : \"unknown client error\" }, \n"
" \"SIMPLE_CLIENT_COULD_NOT_CONNECT\" : { \"code\" : 2001, \"message\" : \"could not connect to server\" }, \n"
" \"SIMPLE_CLIENT_COULD_NOT_WRITE\" : { \"code\" : 2002, \"message\" : \"could not write to server\" }, \n"
" \"SIMPLE_CLIENT_COULD_NOT_READ\" : { \"code\" : 2003, \"message\" : \"could not read from server\" }, \n"
" \"ERROR_ARANGO_INDEX_PQ_INSERT_FAILED\" : { \"code\" : 3100, \"message\" : \"priority queue insert failure\" }, \n"
" \"ERROR_ARANGO_INDEX_PQ_REMOVE_FAILED\" : { \"code\" : 3110, \"message\" : \"priority queue remove failure\" }, \n"
" \"ERROR_ARANGO_INDEX_PQ_REMOVE_ITEM_MISSING\" : { \"code\" : 3111, \"message\" : \"priority queue remove failure - item missing in index\" }, \n"
" \"ERROR_ARANGO_INDEX_HASH_INSERT_ITEM_DUPLICATED\" : { \"code\" : 3312, \"message\" : \"(non-unique) hash index insert failure - document duplicated in index\" }, \n"
" \"ERROR_ARANGO_INDEX_SKIPLIST_INSERT_ITEM_DUPLICATED\" : { \"code\" : 3313, \"message\" : \"(non-unique) skiplist index insert failure - document duplicated in index\" }, \n"
" \"WARNING_ARANGO_INDEX_HASH_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3200, \"message\" : \"hash index insertion warning - attribute missing in document\" }, \n"
" \"WARNING_ARANGO_INDEX_HASH_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3202, \"message\" : \"hash index update warning - attribute missing in revised document\" }, \n"
" \"WARNING_ARANGO_INDEX_HASH_REMOVE_ITEM_MISSING\" : { \"code\" : 3211, \"message\" : \"hash index remove failure - item missing in index\" }, \n"
" \"WARNING_ARANGO_INDEX_SKIPLIST_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3300, \"message\" : \"skiplist index insertion warning - attribute missing in document\" }, \n"
" \"WARNING_ARANGO_INDEX_SKIPLIST_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3302, \"message\" : \"skiplist index update warning - attribute missing in revised document\" }, \n"
" \"WARNING_ARANGO_INDEX_SKIPLIST_REMOVE_ITEM_MISSING\" : { \"code\" : 3311, \"message\" : \"skiplist index remove failure - item missing in index\" }, \n"
" \"WARNING_ARANGO_INDEX_BITARRAY_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3400, \"message\" : \"bitarray index insertion warning - attribute missing in document\" }, \n"
" \"WARNING_ARANGO_INDEX_BITARRAY_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3402, \"message\" : \"bitarray index update warning - attribute missing in revised document\" }, \n"
" \"WARNING_ARANGO_INDEX_BITARRAY_REMOVE_ITEM_MISSING\" : { \"code\" : 3411, \"message\" : \"bitarray index remove failure - item missing in index\" }, \n"
" \"ERROR_ARANGO_INDEX_BITARRAY_INSERT_ITEM_UNSUPPORTED_VALUE\" : { \"code\" : 3413, \"message\" : \"bitarray index insert failure - document attribute value unsupported in index\" }, \n"
" \"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_ATTRIBUTES\" : { \"code\" : 3415, \"message\" : \"bitarray index creation failure - one or more index attributes are duplicated.\" }, \n"
" \"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_VALUES\" : { \"code\" : 3417, \"message\" : \"bitarray index creation failure - one or more index attribute values are duplicated.\" }, \n"
"};\n"
"}());\n"
"\n"
static string JS_common_bootstrap_errors = string("")
+ "/*jslint indent: 2,\n"
+ " nomen: true,\n"
+ " maxlen: 240,\n"
+ " sloppy: true,\n"
+ " vars: true,\n"
+ " white: true,\n"
+ " plusplus: true */\n"
+ "/*global require */\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief auto-generated file generated from errors.dat\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "(function () {\n"
+ " var internal = require(\"internal\");\n"
+ "\n"
+ " internal.errors = {\n"
+ " \"ERROR_NO_ERROR\" : { \"code\" : 0, \"message\" : \"no error\" }, \n"
+ " \"ERROR_FAILED\" : { \"code\" : 1, \"message\" : \"failed\" }, \n"
+ " \"ERROR_SYS_ERROR\" : { \"code\" : 2, \"message\" : \"system error\" }, \n"
+ " \"ERROR_OUT_OF_MEMORY\" : { \"code\" : 3, \"message\" : \"out of memory\" }, \n"
+ " \"ERROR_INTERNAL\" : { \"code\" : 4, \"message\" : \"internal error\" }, \n"
+ " \"ERROR_ILLEGAL_NUMBER\" : { \"code\" : 5, \"message\" : \"illegal number\" }, \n"
+ " \"ERROR_NUMERIC_OVERFLOW\" : { \"code\" : 6, \"message\" : \"numeric overflow\" }, \n"
+ " \"ERROR_ILLEGAL_OPTION\" : { \"code\" : 7, \"message\" : \"illegal option\" }, \n"
+ " \"ERROR_DEAD_PID\" : { \"code\" : 8, \"message\" : \"dead process identifier\" }, \n"
+ " \"ERROR_NOT_IMPLEMENTED\" : { \"code\" : 9, \"message\" : \"not implemented\" }, \n"
+ " \"ERROR_BAD_PARAMETER\" : { \"code\" : 10, \"message\" : \"bad parameter\" }, \n"
+ " \"ERROR_FORBIDDEN\" : { \"code\" : 11, \"message\" : \"forbidden\" }, \n"
+ " \"ERROR_OUT_OF_MEMORY_MMAP\" : { \"code\" : 12, \"message\" : \"out of memory in mmap\" }, \n"
+ " \"ERROR_CORRUPTED_CSV\" : { \"code\" : 13, \"message\" : \"csv is corrupt\" }, \n"
+ " \"ERROR_HTTP_BAD_PARAMETER\" : { \"code\" : 400, \"message\" : \"bad parameter\" }, \n"
+ " \"ERROR_HTTP_FORBIDDEN\" : { \"code\" : 403, \"message\" : \"forbidden\" }, \n"
+ " \"ERROR_HTTP_NOT_FOUND\" : { \"code\" : 404, \"message\" : \"not found\" }, \n"
+ " \"ERROR_HTTP_METHOD_NOT_ALLOWED\" : { \"code\" : 405, \"message\" : \"method not supported\" }, \n"
+ " \"ERROR_HTTP_SERVER_ERROR\" : { \"code\" : 500, \"message\" : \"internal server error\" }, \n"
+ " \"ERROR_HTTP_CORRUPTED_JSON\" : { \"code\" : 600, \"message\" : \"invalid JSON object\" }, \n"
+ " \"ERROR_HTTP_SUPERFLUOUS_SUFFICES\" : { \"code\" : 601, \"message\" : \"superfluous URL suffices\" }, \n"
+ " \"ERROR_ARANGO_ILLEGAL_STATE\" : { \"code\" : 1000, \"message\" : \"illegal state\" }, \n"
+ " \"ERROR_ARANGO_SHAPER_FAILED\" : { \"code\" : 1001, \"message\" : \"illegal shaper\" }, \n"
+ " \"ERROR_ARANGO_DATAFILE_SEALED\" : { \"code\" : 1002, \"message\" : \"datafile sealed\" }, \n"
+ " \"ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE\" : { \"code\" : 1003, \"message\" : \"unknown type\" }, \n"
+ " \"ERROR_ARANGO_READ_ONLY\" : { \"code\" : 1004, \"message\" : \"ready only\" }, \n"
+ " \"ERROR_ARANGO_DUPLICATE_IDENTIFIER\" : { \"code\" : 1005, \"message\" : \"duplicate identifier\" }, \n"
+ " \"ERROR_ARANGO_DATAFILE_UNREADABLE\" : { \"code\" : 1006, \"message\" : \"datafile unreadable\" }, \n"
+ " \"ERROR_ARANGO_CORRUPTED_DATAFILE\" : { \"code\" : 1100, \"message\" : \"corrupted datafile\" }, \n"
+ " \"ERROR_ARANGO_ILLEGAL_PARAMETER_FILE\" : { \"code\" : 1101, \"message\" : \"illegal parameter file\" }, \n"
+ " \"ERROR_ARANGO_CORRUPTED_COLLECTION\" : { \"code\" : 1102, \"message\" : \"corrupted collection\" }, \n"
+ " \"ERROR_ARANGO_MMAP_FAILED\" : { \"code\" : 1103, \"message\" : \"mmap failed\" }, \n"
+ " \"ERROR_ARANGO_FILESYSTEM_FULL\" : { \"code\" : 1104, \"message\" : \"filesystem full\" }, \n"
+ " \"ERROR_ARANGO_NO_JOURNAL\" : { \"code\" : 1105, \"message\" : \"no journal\" }, \n"
+ " \"ERROR_ARANGO_DATAFILE_ALREADY_EXISTS\" : { \"code\" : 1106, \"message\" : \"cannot create/rename datafile because it already exists\" }, \n"
+ " \"ERROR_ARANGO_DATABASE_LOCKED\" : { \"code\" : 1107, \"message\" : \"database is locked\" }, \n"
+ " \"ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS\" : { \"code\" : 1108, \"message\" : \"cannot create/rename collection because directory already exists\" }, \n"
+ " \"ERROR_ARANGO_CONFLICT\" : { \"code\" : 1200, \"message\" : \"conflict\" }, \n"
+ " \"ERROR_ARANGO_WRONG_VOCBASE_PATH\" : { \"code\" : 1201, \"message\" : \"wrong path for database\" }, \n"
+ " \"ERROR_ARANGO_DOCUMENT_NOT_FOUND\" : { \"code\" : 1202, \"message\" : \"document not found\" }, \n"
+ " \"ERROR_ARANGO_COLLECTION_NOT_FOUND\" : { \"code\" : 1203, \"message\" : \"collection not found\" }, \n"
+ " \"ERROR_ARANGO_COLLECTION_PARAMETER_MISSING\" : { \"code\" : 1204, \"message\" : \"parameter 'collection' not found\" }, \n"
+ " \"ERROR_ARANGO_DOCUMENT_HANDLE_BAD\" : { \"code\" : 1205, \"message\" : \"illegal document handle\" }, \n"
+ " \"ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL\" : { \"code\" : 1206, \"message\" : \"maixaml size of journal too small\" }, \n"
+ " \"ERROR_ARANGO_DUPLICATE_NAME\" : { \"code\" : 1207, \"message\" : \"duplicate name\" }, \n"
+ " \"ERROR_ARANGO_ILLEGAL_NAME\" : { \"code\" : 1208, \"message\" : \"illegal name\" }, \n"
+ " \"ERROR_ARANGO_NO_INDEX\" : { \"code\" : 1209, \"message\" : \"no suitable index known\" }, \n"
+ " \"ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED\" : { \"code\" : 1210, \"message\" : \"unique constraint violated\" }, \n"
+ " \"ERROR_ARANGO_GEO_INDEX_VIOLATED\" : { \"code\" : 1211, \"message\" : \"geo index violated\" }, \n"
+ " \"ERROR_ARANGO_INDEX_NOT_FOUND\" : { \"code\" : 1212, \"message\" : \"index not found\" }, \n"
+ " \"ERROR_ARANGO_CROSS_COLLECTION_REQUEST\" : { \"code\" : 1213, \"message\" : \"cross collection request not allowed\" }, \n"
+ " \"ERROR_ARANGO_INDEX_HANDLE_BAD\" : { \"code\" : 1214, \"message\" : \"illegal index handle\" }, \n"
+ " \"ERROR_ARANGO_CAP_CONSTRAINT_ALREADY_DEFINED\" : { \"code\" : 1215, \"message\" : \"cap constraint already defined\" }, \n"
+ " \"ERROR_ARANGO_DOCUMENT_TOO_LARGE\" : { \"code\" : 1216, \"message\" : \"document too large\" }, \n"
+ " \"ERROR_ARANGO_COLLECTION_NOT_UNLOADED\" : { \"code\" : 1217, \"message\" : \"collection must be unloaded\" }, \n"
+ " \"ERROR_ARANGO_COLLECTION_TYPE_INVALID\" : { \"code\" : 1218, \"message\" : \"collection type invalid\" }, \n"
+ " \"ERROR_ARANGO_DATAFILE_FULL\" : { \"code\" : 1300, \"message\" : \"datafile full\" }, \n"
+ " \"ERROR_QUERY_KILLED\" : { \"code\" : 1500, \"message\" : \"query killed\" }, \n"
+ " \"ERROR_QUERY_PARSE\" : { \"code\" : 1501, \"message\" : \"%s\" }, \n"
+ " \"ERROR_QUERY_EMPTY\" : { \"code\" : 1502, \"message\" : \"query is empty\" }, \n"
+ " \"ERROR_QUERY_SCRIPT\" : { \"code\" : 1503, \"message\" : \"runtime error '%s'\" }, \n"
+ " \"ERROR_QUERY_NUMBER_OUT_OF_RANGE\" : { \"code\" : 1504, \"message\" : \"number out of range\" }, \n"
+ " \"ERROR_QUERY_VARIABLE_NAME_INVALID\" : { \"code\" : 1510, \"message\" : \"variable name '%s' has an invalid format\" }, \n"
+ " \"ERROR_QUERY_VARIABLE_REDECLARED\" : { \"code\" : 1511, \"message\" : \"variable '%s' is assigned multiple times\" }, \n"
+ " \"ERROR_QUERY_VARIABLE_NAME_UNKNOWN\" : { \"code\" : 1512, \"message\" : \"unknown variable '%s'\" }, \n"
+ " \"ERROR_QUERY_COLLECTION_NOT_FOUND\" : { \"code\" : 1520, \"message\" : \"unable to open collection '%s'\" }, \n"
+ " \"ERROR_QUERY_COLLECTION_LOCK_FAILED\" : { \"code\" : 1521, \"message\" : \"unable to read-lock collection %s\" }, \n"
+ " \"ERROR_QUERY_TOO_MANY_COLLECTIONS\" : { \"code\" : 1522, \"message\" : \"too many collections\" }, \n"
+ " \"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED\" : { \"code\" : 1530, \"message\" : \"document attribute '%s' is assigned multiple times\" }, \n"
+ " \"ERROR_QUERY_FUNCTION_NAME_UNKNOWN\" : { \"code\" : 1540, \"message\" : \"usage of unknown function '%s'\" }, \n"
+ " \"ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH\" : { \"code\" : 1541, \"message\" : \"invalid number of arguments for function '%s'\" }, \n"
+ " \"ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH\" : { \"code\" : 1542, \"message\" : \"invalid argument type used in call to function '%s()'\" }, \n"
+ " \"ERROR_QUERY_BIND_PARAMETERS_INVALID\" : { \"code\" : 1550, \"message\" : \"invalid structure of bind parameters\" }, \n"
+ " \"ERROR_QUERY_BIND_PARAMETER_MISSING\" : { \"code\" : 1551, \"message\" : \"no value specified for declared bind parameter '%s'\" }, \n"
+ " \"ERROR_QUERY_BIND_PARAMETER_UNDECLARED\" : { \"code\" : 1552, \"message\" : \"bind parameter '%s' was not declared in the query\" }, \n"
+ " \"ERROR_QUERY_BIND_PARAMETER_TYPE\" : { \"code\" : 1553, \"message\" : \"bind parameter '%s' has an invalid value or type\" }, \n"
+ " \"ERROR_QUERY_INVALID_LOGICAL_VALUE\" : { \"code\" : 1560, \"message\" : \"invalid logical value\" }, \n"
+ " \"ERROR_QUERY_INVALID_ARITHMETIC_VALUE\" : { \"code\" : 1561, \"message\" : \"invalid arithmetic value\" }, \n"
+ " \"ERROR_QUERY_DIVISION_BY_ZERO\" : { \"code\" : 1562, \"message\" : \"division by zero\" }, \n"
+ " \"ERROR_QUERY_LIST_EXPECTED\" : { \"code\" : 1563, \"message\" : \"list expected\" }, \n"
+ " \"ERROR_QUERY_FAIL_CALLED\" : { \"code\" : 1569, \"message\" : \"FAIL(%s) called\" }, \n"
+ " \"ERROR_QUERY_GEO_INDEX_MISSING\" : { \"code\" : 1570, \"message\" : \"no suitable geo index found for geo restriction on '%s'\" }, \n"
+ " \"ERROR_CURSOR_NOT_FOUND\" : { \"code\" : 1600, \"message\" : \"cursor not found\" }, \n"
+ " \"ERROR_KEYVALUE_INVALID_KEY\" : { \"code\" : 1800, \"message\" : \"invalid key declaration\" }, \n"
+ " \"ERROR_KEYVALUE_KEY_EXISTS\" : { \"code\" : 1801, \"message\" : \"key already exists\" }, \n"
+ " \"ERROR_KEYVALUE_KEY_NOT_FOUND\" : { \"code\" : 1802, \"message\" : \"key not found\" }, \n"
+ " \"ERROR_KEYVALUE_KEY_NOT_UNIQUE\" : { \"code\" : 1803, \"message\" : \"key is not unique\" }, \n"
+ " \"ERROR_KEYVALUE_KEY_NOT_CHANGED\" : { \"code\" : 1804, \"message\" : \"key value not changed\" }, \n"
+ " \"ERROR_KEYVALUE_KEY_NOT_REMOVED\" : { \"code\" : 1805, \"message\" : \"key value not removed\" }, \n"
+ " \"ERROR_KEYVALUE_NO_VALUE\" : { \"code\" : 1806, \"message\" : \"missing value\" }, \n"
+ " \"ERROR_GRAPH_INVALID_GRAPH\" : { \"code\" : 1901, \"message\" : \"invalid graph\" }, \n"
+ " \"ERROR_GRAPH_COULD_NOT_CREATE_GRAPH\" : { \"code\" : 1902, \"message\" : \"could not create graph\" }, \n"
+ " \"ERROR_GRAPH_INVALID_VERTEX\" : { \"code\" : 1903, \"message\" : \"invalid vertex\" }, \n"
+ " \"ERROR_GRAPH_COULD_NOT_CREATE_VERTEX\" : { \"code\" : 1904, \"message\" : \"could not create vertex\" }, \n"
+ " \"ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX\" : { \"code\" : 1905, \"message\" : \"could not change vertex\" }, \n"
+ " \"ERROR_GRAPH_INVALID_EDGE\" : { \"code\" : 1906, \"message\" : \"invalid edge\" }, \n"
+ " \"ERROR_GRAPH_COULD_NOT_CREATE_EDGE\" : { \"code\" : 1907, \"message\" : \"could not create edge\" }, \n"
+ " \"ERROR_GRAPH_COULD_NOT_CHANGE_EDGE\" : { \"code\" : 1908, \"message\" : \"could not change edge\" }, \n"
+ " \"SIMPLE_CLIENT_UNKNOWN_ERROR\" : { \"code\" : 2000, \"message\" : \"unknown client error\" }, \n"
+ " \"SIMPLE_CLIENT_COULD_NOT_CONNECT\" : { \"code\" : 2001, \"message\" : \"could not connect to server\" }, \n"
+ " \"SIMPLE_CLIENT_COULD_NOT_WRITE\" : { \"code\" : 2002, \"message\" : \"could not write to server\" }, \n"
+ " \"SIMPLE_CLIENT_COULD_NOT_READ\" : { \"code\" : 2003, \"message\" : \"could not read from server\" }, \n"
+ " \"ERROR_ARANGO_INDEX_PQ_INSERT_FAILED\" : { \"code\" : 3100, \"message\" : \"priority queue insert failure\" }, \n"
+ " \"ERROR_ARANGO_INDEX_PQ_REMOVE_FAILED\" : { \"code\" : 3110, \"message\" : \"priority queue remove failure\" }, \n"
+ " \"ERROR_ARANGO_INDEX_PQ_REMOVE_ITEM_MISSING\" : { \"code\" : 3111, \"message\" : \"priority queue remove failure - item missing in index\" }, \n"
+ " \"ERROR_ARANGO_INDEX_HASH_INSERT_ITEM_DUPLICATED\" : { \"code\" : 3312, \"message\" : \"(non-unique) hash index insert failure - document duplicated in index\" }, \n"
+ " \"ERROR_ARANGO_INDEX_SKIPLIST_INSERT_ITEM_DUPLICATED\" : { \"code\" : 3313, \"message\" : \"(non-unique) skiplist index insert failure - document duplicated in index\" }, \n"
+ " \"WARNING_ARANGO_INDEX_HASH_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3200, \"message\" : \"hash index insertion warning - attribute missing in document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_HASH_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3202, \"message\" : \"hash index update warning - attribute missing in revised document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_HASH_REMOVE_ITEM_MISSING\" : { \"code\" : 3211, \"message\" : \"hash index remove failure - item missing in index\" }, \n"
+ " \"WARNING_ARANGO_INDEX_SKIPLIST_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3300, \"message\" : \"skiplist index insertion warning - attribute missing in document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_SKIPLIST_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3302, \"message\" : \"skiplist index update warning - attribute missing in revised document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_SKIPLIST_REMOVE_ITEM_MISSING\" : { \"code\" : 3311, \"message\" : \"skiplist index remove failure - item missing in index\" }, \n"
+ " \"WARNING_ARANGO_INDEX_BITARRAY_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3400, \"message\" : \"bitarray index insertion warning - attribute missing in document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_BITARRAY_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3402, \"message\" : \"bitarray index update warning - attribute missing in revised document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_BITARRAY_REMOVE_ITEM_MISSING\" : { \"code\" : 3411, \"message\" : \"bitarray index remove failure - item missing in index\" }, \n"
+ " \"ERROR_ARANGO_INDEX_BITARRAY_INSERT_ITEM_UNSUPPORTED_VALUE\" : { \"code\" : 3413, \"message\" : \"bitarray index insert failure - document attribute value unsupported in index\" }, \n"
+ " \"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_ATTRIBUTES\" : { \"code\" : 3415, \"message\" : \"bitarray index creation failure - one or more index attributes are duplicated.\" }, \n"
+ " \"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_VALUES\" : { \"code\" : 3417, \"message\" : \"bitarray index creation failure - one or more index attribute values are duplicated.\" }, \n"
+ "};\n"
+ "}());\n"
+ "\n"
;

File diff suppressed because it is too large Load Diff

View File

@ -1,333 +1,333 @@
static string JS_common_bootstrap_print =
"/*jslint indent: 2,\n"
" nomen: true,\n"
" maxlen: 100,\n"
" sloppy: true,\n"
" vars: true,\n"
" white: true,\n"
" plusplus: true */\n"
"/*global require, print */\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief printing\n"
"///\n"
"/// @file\n"
"///\n"
"/// DISCLAIMER\n"
"///\n"
"/// Copyright 2010-2012 triagens GmbH, Cologne, Germany\n"
"///\n"
"/// Licensed under the Apache License, Version 2.0 (the \"License\");\n"
"/// you may not use this file except in compliance with the License.\n"
"/// You may obtain a copy of the License at\n"
"///\n"
"/// http://www.apache.org/licenses/LICENSE-2.0\n"
"///\n"
"/// Unless required by applicable law or agreed to in writing, software\n"
"/// distributed under the License is distributed on an \"AS IS\" BASIS,\n"
"/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
"/// See the License for the specific language governing permissions and\n"
"/// limitations under the License.\n"
"///\n"
"/// Copyright holder is triAGENS GmbH, Cologne, Germany\n"
"///\n"
"/// @author Dr. Frank Celler\n"
"/// @author Copyright 2011-2012, triAGENS GmbH, Cologne, Germany\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
"(function () {\n"
" var internal = require(\"internal\");\n"
"\n"
"// -----------------------------------------------------------------------------\n"
"// --SECTION-- Module \"internal\"\n"
"// -----------------------------------------------------------------------------\n"
"\n"
"// -----------------------------------------------------------------------------\n"
"// --SECTION-- private functions\n"
"// -----------------------------------------------------------------------------\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @addtogroup V8Shell\n"
"/// @{\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief prints objects to standard output\n"
"///\n"
"/// @FUN{internal.printShell(@FA{arg1}, @FA{arg2}, @FA{arg3}, ...)}\n"
"///\n"
"/// Only available in shell mode.\n"
"///\n"
"/// Prints the arguments. If an argument is an object having a\n"
"/// function @FN{_PRINT}, then this function is called. Otherwise @FN{toJson} is\n"
"/// used. A final newline is printed\n"
"///\n"
"/// @verbinclude fluent40\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
" internal.printShell = function () {\n"
" var i;\n"
"\n"
" for (i = 0; i < arguments.length; ++i) {\n"
" if (0 < i) {\n"
" internal.output(\" \");\n"
" }\n"
"\n"
" if (typeof(arguments[i]) === \"string\") {\n"
" internal.output(arguments[i]);\n"
" }\n"
" else {\n"
" internal.printRecursive(arguments[i], [], \"~\", [], 0);\n"
" }\n"
" }\n"
"\n"
" if (internal.COLOR_OUTPUT) {\n"
" internal.output(internal.COLOR_OUTPUT_RESET);\n"
" }\n"
"\n"
" internal.output(\"\\n\");\n"
" };\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief quote cache\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
" internal.characterQuoteCache = {\n"
" '\\b': '\\\\b', // ASCII 8, Backspace\n"
" '\\t': '\\\\t', // ASCII 9, Tab\n"
" '\\n': '\\\\n', // ASCII 10, Newline\n"
" '\\f': '\\\\f', // ASCII 12, Formfeed\n"
" '\\r': '\\\\r', // ASCII 13, Carriage Return\n"
" '\\\"': '\\\\\"',\n"
" '\\\\': '\\\\\\\\'\n"
" };\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief quotes a single character\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
" internal.quoteSingleJsonCharacter = function (c) {\n"
" if (internal.characterQuoteCache.hasOwnProperty[c]) {\n"
" return internal.characterQuoteCache[c];\n"
" }\n"
"\n"
" var charCode = c.charCodeAt(0);\n"
" var result;\n"
"\n"
" if (charCode < 16) {\n"
" result = '\\\\u000';\n"
" }\n"
" else if (charCode < 256) {\n"
" result = '\\\\u00';\n"
" }\n"
" else if (charCode < 4096) {\n"
" result = '\\\\u0';\n"
" }\n"
" else {\n"
" result = '\\\\u';\n"
" }\n"
"\n"
" result += charCode.toString(16);\n"
" internal.characterQuoteCache[c] = result;\n"
"\n"
" return result;\n"
" };\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief quotes a string character\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
" internal.quoteJsonString = function (str) {\n"
" var quotable = /[\\\\\\\"\\x00-\\x1f]/g;\n"
" return '\"' + str.replace(quotable, internal.quoteSingleJsonCharacter) + '\"';\n"
" };\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief prints objects to standard output without a new-line\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
" internal.printRecursive = function (value, seen, path, names, level) {\n"
" var p;\n"
"\n"
" if (seen === undefined) {\n"
" seen = [];\n"
" names = [];\n"
" }\n"
"\n"
" p = seen.indexOf(value);\n"
"\n"
" if (0 <= p) {\n"
" internal.output(names[p]);\n"
" }\n"
" else {\n"
" if (value instanceof Object) {\n"
" seen.push(value);\n"
" names.push(path);\n"
" }\n"
"\n"
" if (value instanceof Object) {\n"
" if ('_PRINT' in value) {\n"
" value._PRINT(seen, path, names, level);\n"
" }\n"
" else if (value instanceof Array) {\n"
" internal.printArray(value, seen, path, names, level);\n"
" }\n"
" else if (value.__proto__ === Object.prototype) {\n"
" internal.printObject(value, seen, path, names, level);\n"
" }\n"
" else if ('toString' in value) {\n"
" internal.output(value.toString());\n"
" }\n"
" else {\n"
" internal.printObject(value, seen, path, names, level);\n"
" }\n"
" }\n"
" else if (value === undefined) {\n"
" internal.output(\"undefined\");\n"
" }\n"
" else {\n"
" if (typeof(value) === \"string\") {\n"
" internal.output(internal.quoteJsonString(value));\n"
" }\n"
" else {\n"
" internal.output(String(value));\n"
" }\n"
" }\n"
" }\n"
" };\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief prints the ident for pretty printing\n"
"///\n"
"/// @FUN{internal.printIndent(@FA{level})}\n"
"///\n"
"/// Only available in shell mode.\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
" internal.printIndent = function (level) {\n"
" var j;\n"
"\n"
" if (internal.PRETTY_PRINT) {\n"
" internal.output(\"\\n\");\n"
"\n"
" for (j = 0; j < level; ++j) {\n"
" internal.output(\" \");\n"
" }\n"
" }\n"
" };\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief JSON representation of an array\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
" internal.printArray = function (object, seen, path, names, level) {\n"
" if (object.length === 0) {\n"
" internal.output(\"[ ]\");\n"
" }\n"
" else {\n"
" var i;\n"
" var sep = \"\";\n"
"\n"
" internal.output(\"[\");\n"
"\n"
" var newLevel = level + 1;\n"
"\n"
" for (i = 0; i < object.length; i++) {\n"
" internal.output(sep);\n"
"\n"
" internal.printIndent(newLevel);\n"
"\n"
" internal.printRecursive(object[i],\n"
" seen,\n"
" path + \"[\" + i + \"]\",\n"
" names,\n"
" newLevel);\n"
" sep = \", \";\n"
" }\n"
"\n"
" internal.printIndent(level);\n"
"\n"
" internal.output(\"]\");\n"
" }\n"
" };\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief prints an object\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
" internal.printObject = function (object, seen, path, names, level) {\n"
" var sep = \" \";\n"
" var k;\n"
"\n"
" internal.output(\"{\");\n"
"\n"
" var newLevel = level + 1;\n"
"\n"
" for (k in object) {\n"
" if (object.hasOwnProperty(k)) {\n"
" var val = object[k];\n"
"\n"
" internal.output(sep);\n"
"\n"
" internal.printIndent(newLevel);\n"
"\n"
" if (internal.COLOR_OUTPUT) {\n"
" internal.output(internal.COLOR_OUTPUT_DEFAULT,\n"
" k,\n"
" internal.COLOR_OUTPUT_RESET, \n"
" \" : \");\n"
" }\n"
" else {\n"
" internal.output(internal.quoteJsonString(k), \" : \");\n"
" }\n"
"\n"
" internal.printRecursive(val,\n"
" seen,\n"
" path + \"[\" + k + \"]\",\n"
" names,\n"
" newLevel);\n"
" sep = \", \";\n"
" }\n"
" }\n"
"\n"
" internal.printIndent(level);\n"
"\n"
" internal.output(\" }\");\n"
" };\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @}\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
"}());\n"
"\n"
"// -----------------------------------------------------------------------------\n"
"// --SECTION-- global functions\n"
"// -----------------------------------------------------------------------------\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @addtogroup V8Shell\n"
"/// @{\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief global print\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
"// must be a variable definition for the browser\n"
"if (typeof require(\"internal\").printBrowser === \"function\") {\n"
" print = require(\"internal\").print = require(\"internal\").printBrowser;\n"
"}\n"
"else {\n"
" print = require(\"internal\").print = require(\"internal\").printShell;\n"
"}\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @}\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
"// Local Variables:\n"
"// mode: outline-minor\n"
"// outline-regexp: \"^\\\\(/// @brief\\\\|/// @addtogroup\\\\|// --SECTION--\\\\|/// @page\\\\|/// @}\\\\)\"\n"
"// End:\n"
static string JS_common_bootstrap_print = string("")
+ "/*jslint indent: 2,\n"
+ " nomen: true,\n"
+ " maxlen: 100,\n"
+ " sloppy: true,\n"
+ " vars: true,\n"
+ " white: true,\n"
+ " plusplus: true */\n"
+ "/*global require, print */\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief printing\n"
+ "///\n"
+ "/// @file\n"
+ "///\n"
+ "/// DISCLAIMER\n"
+ "///\n"
+ "/// Copyright 2010-2012 triagens GmbH, Cologne, Germany\n"
+ "///\n"
+ "/// Licensed under the Apache License, Version 2.0 (the \"License\");\n"
+ "/// you may not use this file except in compliance with the License.\n"
+ "/// You may obtain a copy of the License at\n"
+ "///\n"
+ "/// http://www.apache.org/licenses/LICENSE-2.0\n"
+ "///\n"
+ "/// Unless required by applicable law or agreed to in writing, software\n"
+ "/// distributed under the License is distributed on an \"AS IS\" BASIS,\n"
+ "/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
+ "/// See the License for the specific language governing permissions and\n"
+ "/// limitations under the License.\n"
+ "///\n"
+ "/// Copyright holder is triAGENS GmbH, Cologne, Germany\n"
+ "///\n"
+ "/// @author Dr. Frank Celler\n"
+ "/// @author Copyright 2011-2012, triAGENS GmbH, Cologne, Germany\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "(function () {\n"
+ " var internal = require(\"internal\");\n"
+ "\n"
+ "// -----------------------------------------------------------------------------\n"
+ "// --SECTION-- Module \"internal\"\n"
+ "// -----------------------------------------------------------------------------\n"
+ "\n"
+ "// -----------------------------------------------------------------------------\n"
+ "// --SECTION-- private functions\n"
+ "// -----------------------------------------------------------------------------\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @addtogroup V8Shell\n"
+ "/// @{\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief prints objects to standard output\n"
+ "///\n"
+ "/// @FUN{internal.printShell(@FA{arg1}, @FA{arg2}, @FA{arg3}, ...)}\n"
+ "///\n"
+ "/// Only available in shell mode.\n"
+ "///\n"
+ "/// Prints the arguments. If an argument is an object having a\n"
+ "/// function @FN{_PRINT}, then this function is called. Otherwise @FN{toJson} is\n"
+ "/// used. A final newline is printed\n"
+ "///\n"
+ "/// @verbinclude fluent40\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.printShell = function () {\n"
+ " var i;\n"
+ "\n"
+ " for (i = 0; i < arguments.length; ++i) {\n"
+ " if (0 < i) {\n"
+ " internal.output(\" \");\n"
+ " }\n"
+ "\n"
+ " if (typeof(arguments[i]) === \"string\") {\n"
+ " internal.output(arguments[i]);\n"
+ " }\n"
+ " else {\n"
+ " internal.printRecursive(arguments[i], [], \"~\", [], 0);\n"
+ " }\n"
+ " }\n"
+ "\n"
+ " if (internal.COLOR_OUTPUT) {\n"
+ " internal.output(internal.COLOR_OUTPUT_RESET);\n"
+ " }\n"
+ "\n"
+ " internal.output(\"\\n\");\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief quote cache\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.characterQuoteCache = {\n"
+ " '\\b': '\\\\b', // ASCII 8, Backspace\n"
+ " '\\t': '\\\\t', // ASCII 9, Tab\n"
+ " '\\n': '\\\\n', // ASCII 10, Newline\n"
+ " '\\f': '\\\\f', // ASCII 12, Formfeed\n"
+ " '\\r': '\\\\r', // ASCII 13, Carriage Return\n"
+ " '\\\"': '\\\\\"',\n"
+ " '\\\\': '\\\\\\\\'\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief quotes a single character\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.quoteSingleJsonCharacter = function (c) {\n"
+ " if (internal.characterQuoteCache.hasOwnProperty[c]) {\n"
+ " return internal.characterQuoteCache[c];\n"
+ " }\n"
+ "\n"
+ " var charCode = c.charCodeAt(0);\n"
+ " var result;\n"
+ "\n"
+ " if (charCode < 16) {\n"
+ " result = '\\\\u000';\n"
+ " }\n"
+ " else if (charCode < 256) {\n"
+ " result = '\\\\u00';\n"
+ " }\n"
+ " else if (charCode < 4096) {\n"
+ " result = '\\\\u0';\n"
+ " }\n"
+ " else {\n"
+ " result = '\\\\u';\n"
+ " }\n"
+ "\n"
+ " result += charCode.toString(16);\n"
+ " internal.characterQuoteCache[c] = result;\n"
+ "\n"
+ " return result;\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief quotes a string character\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.quoteJsonString = function (str) {\n"
+ " var quotable = /[\\\\\\\"\\x00-\\x1f]/g;\n"
+ " return '\"' + str.replace(quotable, internal.quoteSingleJsonCharacter) + '\"';\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief prints objects to standard output without a new-line\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.printRecursive = function (value, seen, path, names, level) {\n"
+ " var p;\n"
+ "\n"
+ " if (seen === undefined) {\n"
+ " seen = [];\n"
+ " names = [];\n"
+ " }\n"
+ "\n"
+ " p = seen.indexOf(value);\n"
+ "\n"
+ " if (0 <= p) {\n"
+ " internal.output(names[p]);\n"
+ " }\n"
+ " else {\n"
+ " if (value instanceof Object) {\n"
+ " seen.push(value);\n"
+ " names.push(path);\n"
+ " }\n"
+ "\n"
+ " if (value instanceof Object) {\n"
+ " if ('_PRINT' in value) {\n"
+ " value._PRINT(seen, path, names, level);\n"
+ " }\n"
+ " else if (value instanceof Array) {\n"
+ " internal.printArray(value, seen, path, names, level);\n"
+ " }\n"
+ " else if (value.__proto__ === Object.prototype) {\n"
+ " internal.printObject(value, seen, path, names, level);\n"
+ " }\n"
+ " else if ('toString' in value) {\n"
+ " internal.output(value.toString());\n"
+ " }\n"
+ " else {\n"
+ " internal.printObject(value, seen, path, names, level);\n"
+ " }\n"
+ " }\n"
+ " else if (value === undefined) {\n"
+ " internal.output(\"undefined\");\n"
+ " }\n"
+ " else {\n"
+ " if (typeof(value) === \"string\") {\n"
+ " internal.output(internal.quoteJsonString(value));\n"
+ " }\n"
+ " else {\n"
+ " internal.output(String(value));\n"
+ " }\n"
+ " }\n"
+ " }\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief prints the ident for pretty printing\n"
+ "///\n"
+ "/// @FUN{internal.printIndent(@FA{level})}\n"
+ "///\n"
+ "/// Only available in shell mode.\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.printIndent = function (level) {\n"
+ " var j;\n"
+ "\n"
+ " if (internal.PRETTY_PRINT) {\n"
+ " internal.output(\"\\n\");\n"
+ "\n"
+ " for (j = 0; j < level; ++j) {\n"
+ " internal.output(\" \");\n"
+ " }\n"
+ " }\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief JSON representation of an array\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.printArray = function (object, seen, path, names, level) {\n"
+ " if (object.length === 0) {\n"
+ " internal.output(\"[ ]\");\n"
+ " }\n"
+ " else {\n"
+ " var i;\n"
+ " var sep = \"\";\n"
+ "\n"
+ " internal.output(\"[\");\n"
+ "\n"
+ " var newLevel = level + 1;\n"
+ "\n"
+ " for (i = 0; i < object.length; i++) {\n"
+ " internal.output(sep);\n"
+ "\n"
+ " internal.printIndent(newLevel);\n"
+ "\n"
+ " internal.printRecursive(object[i],\n"
+ " seen,\n"
+ " path + \"[\" + i + \"]\",\n"
+ " names,\n"
+ " newLevel);\n"
+ " sep = \", \";\n"
+ " }\n"
+ "\n"
+ " internal.printIndent(level);\n"
+ "\n"
+ " internal.output(\"]\");\n"
+ " }\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief prints an object\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.printObject = function (object, seen, path, names, level) {\n"
+ " var sep = \" \";\n"
+ " var k;\n"
+ "\n"
+ " internal.output(\"{\");\n"
+ "\n"
+ " var newLevel = level + 1;\n"
+ "\n"
+ " for (k in object) {\n"
+ " if (object.hasOwnProperty(k)) {\n"
+ " var val = object[k];\n"
+ "\n"
+ " internal.output(sep);\n"
+ "\n"
+ " internal.printIndent(newLevel);\n"
+ "\n"
+ " if (internal.COLOR_OUTPUT) {\n"
+ " internal.output(internal.COLOR_OUTPUT_DEFAULT,\n"
+ " k,\n"
+ " internal.COLOR_OUTPUT_RESET, \n"
+ " \" : \");\n"
+ " }\n"
+ " else {\n"
+ " internal.output(internal.quoteJsonString(k), \" : \");\n"
+ " }\n"
+ "\n"
+ " internal.printRecursive(val,\n"
+ " seen,\n"
+ " path + \"[\" + k + \"]\",\n"
+ " names,\n"
+ " newLevel);\n"
+ " sep = \", \";\n"
+ " }\n"
+ " }\n"
+ "\n"
+ " internal.printIndent(level);\n"
+ "\n"
+ " internal.output(\" }\");\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @}\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "}());\n"
+ "\n"
+ "// -----------------------------------------------------------------------------\n"
+ "// --SECTION-- global functions\n"
+ "// -----------------------------------------------------------------------------\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @addtogroup V8Shell\n"
+ "/// @{\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief global print\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "// must be a variable definition for the browser\n"
+ "if (typeof require(\"internal\").printBrowser === \"function\") {\n"
+ " print = require(\"internal\").print = require(\"internal\").printBrowser;\n"
+ "}\n"
+ "else {\n"
+ " print = require(\"internal\").print = require(\"internal\").printShell;\n"
+ "}\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @}\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "// Local Variables:\n"
+ "// mode: outline-minor\n"
+ "// outline-regexp: \"^\\\\(/// @brief\\\\|/// @addtogroup\\\\|// --SECTION--\\\\|/// @page\\\\|/// @}\\\\)\"\n"
+ "// End:\n"
;

View File

@ -105,13 +105,13 @@ namespace triagens {
/// @brief return the protocol to be used
////////////////////////////////////////////////////////////////////////////////
virtual Endpoint::Protocol getProtocol () const = 0;
virtual Endpoint::ProtocolType getProtocol () const = 0;
////////////////////////////////////////////////////////////////////////////////
/// @brief return the encryption to be used
////////////////////////////////////////////////////////////////////////////////
virtual Endpoint::Encryption getEncryption () const = 0;
virtual Endpoint::EncryptionType getEncryption () const = 0;
////////////////////////////////////////////////////////////////////////////////
/// @brief add the endpoint list

View File

@ -235,7 +235,7 @@ namespace triagens {
/// @brief return encryption to be used
////////////////////////////////////////////////////////////////////////////////
virtual Endpoint::Encryption getEncryption () const {
virtual Endpoint::EncryptionType getEncryption () const {
return Endpoint::ENCRYPTION_SSL;
}

View File

@ -101,7 +101,7 @@ namespace triagens {
/// @brief return the protocol to be used
////////////////////////////////////////////////////////////////////////////////
Endpoint::Protocol getProtocol () const {
Endpoint::ProtocolType getProtocol () const {
return Endpoint::PROTOCOL_HTTP;
}

View File

@ -102,7 +102,7 @@ namespace triagens {
/// @brief return encryption to be used
////////////////////////////////////////////////////////////////////////////////
virtual Endpoint::Encryption getEncryption () const {
virtual Endpoint::EncryptionType getEncryption () const {
return Endpoint::ENCRYPTION_NONE;
}

View File

@ -73,10 +73,10 @@ const std::string EndpointIp::_defaultHost = "127.0.0.1";
/// @brief create an endpoint
////////////////////////////////////////////////////////////////////////////////
Endpoint::Endpoint (const Endpoint::Type type,
Endpoint::Endpoint (const Endpoint::EndpointType type,
const Endpoint::DomainType domainType,
const Endpoint::Protocol protocol,
const Endpoint::Encryption encryption,
const Endpoint::ProtocolType protocol,
const Endpoint::EncryptionType encryption,
const std::string& specification,
int listenBacklog) :
_connected(false),
@ -129,7 +129,7 @@ Endpoint* Endpoint::serverFactory (const std::string& specification, int listenB
/// @brief create an endpoint object from a string value
////////////////////////////////////////////////////////////////////////////////
Endpoint* Endpoint::factory (const Endpoint::Type type,
Endpoint* Endpoint::factory (const Endpoint::EndpointType type,
const std::string& specification,
int listenBacklog) {
if (specification.size() < 7) {
@ -148,7 +148,7 @@ Endpoint* Endpoint::factory (const Endpoint::Type type,
}
// default protocol is HTTP
Endpoint::Protocol protocol = PROTOCOL_HTTP;
Endpoint::ProtocolType protocol = PROTOCOL_HTTP;
// read protocol from string
size_t found = copy.find('@');
@ -163,18 +163,28 @@ Endpoint* Endpoint::factory (const Endpoint::Type type,
}
}
Encryption encryption = ENCRYPTION_NONE;
EncryptionType encryption = ENCRYPTION_NONE;
string domainType = StringUtils::tolower(copy.substr(0, 7));
if (StringUtils::isPrefix(domainType, "ssl://")) {
// ssl
encryption = ENCRYPTION_SSL;
}
#if TRI_HAVE_LINUX_SOCKETS
else if (StringUtils::isPrefix(domainType, "unix://")) {
// unix socket
return new EndpointUnix(type, protocol, specification, listenBacklog, copy.substr(strlen("unix://")));
}
#endif
#else
// no unix socket for windows
else if (StringUtils::isPrefix(domainType, "unix://")) {
// unix socket
return 0;
}
#endif
else if (! StringUtils::isPrefix(domainType, "tcp://")) {
// invalid type
return 0;
@ -243,8 +253,9 @@ void Endpoint::setTimeout (socket_t s, double timeout) {
tv.tv_sec = (uint64_t) timeout;
tv.tv_usec = ((uint64_t) (timeout * 1000000.0)) % 1000000;
setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
// conversion to (const char*) ensures windows does not complain
setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (const char*)(&tv), sizeof(tv));
setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (const char*)(&tv), sizeof(tv));
}
////////////////////////////////////////////////////////////////////////////////
@ -299,12 +310,12 @@ bool Endpoint::setSocketFlags (socket_t _socket) {
/// @brief creates a Unix socket endpoint
////////////////////////////////////////////////////////////////////////////////
EndpointUnix::EndpointUnix (const Endpoint::Type type,
const Endpoint::Protocol protocol,
string const& specification,
EndpointUnix::EndpointUnix (const Endpoint::EndpointType type,
const Endpoint::ProtocolType protocol,
const std::string& specification,
int listenBacklog,
string const& path) :
Endpoint(type, ENDPOINT_UNIX, protocol, ENCRYPTION_NONE, specification, listenBacklog),
const std::string& path) :
Endpoint(type, DOMAIN_UNIX, protocol, ENCRYPTION_NONE, specification, listenBacklog),
_path(path) {
}
@ -481,17 +492,17 @@ bool EndpointUnix::initIncoming (socket_t incoming) {
/// @brief creates an IP socket endpoint
////////////////////////////////////////////////////////////////////////////////
EndpointIp::EndpointIp (const Endpoint::Type type,
EndpointIp::EndpointIp (const Endpoint::EndpointType type,
const Endpoint::DomainType domainType,
const Endpoint::Protocol protocol,
const Endpoint::Encryption encryption,
const Endpoint::ProtocolType protocol,
const Endpoint::EncryptionType encryption,
const std::string& specification,
int listenBacklog,
const std::string& host,
const uint16_t port) :
Endpoint(type, domainType, protocol, encryption, specification, listenBacklog), _host(host), _port(port) {
assert(domainType == ENDPOINT_IPV4 || domainType == ENDPOINT_IPV6);
assert(domainType == DOMAIN_IPV4 || domainType == Endpoint::DOMAIN_IPV6);
}
////////////////////////////////////////////////////////////////////////////////
@ -712,14 +723,14 @@ bool EndpointIp::initIncoming (socket_t incoming) {
/// @brief creates an IPv4 socket endpoint
////////////////////////////////////////////////////////////////////////////////
EndpointIpV4::EndpointIpV4 (const Endpoint::Type type,
const Endpoint::Protocol protocol,
const Endpoint::Encryption encryption,
string const& specification,
EndpointIpV4::EndpointIpV4 (const Endpoint::EndpointType type,
const Endpoint::ProtocolType protocol,
const Endpoint::EncryptionType encryption,
const std::string& specification,
int listenBacklog,
string const& host,
const std::string& host,
const uint16_t port) :
EndpointIp(type, ENDPOINT_IPV4, protocol, encryption, specification, listenBacklog, host, port) {
EndpointIp(type, DOMAIN_IPV4, protocol, encryption, specification, listenBacklog, host, port) {
}
////////////////////////////////////////////////////////////////////////////////
@ -750,14 +761,14 @@ EndpointIpV4::~EndpointIpV4 () {
/// @brief creates an IPv6 socket endpoint
////////////////////////////////////////////////////////////////////////////////
EndpointIpV6::EndpointIpV6 (const Endpoint::Type type,
const Endpoint::Protocol protocol,
const Endpoint::Encryption encryption,
string const& specification,
EndpointIpV6::EndpointIpV6 (const Endpoint::EndpointType type,
const Endpoint::ProtocolType protocol,
const Endpoint::EncryptionType encryption,
const std::string& specification,
int listenBacklog,
string const& host,
const std::string& host,
const uint16_t port) :
EndpointIp(type, ENDPOINT_IPV6, protocol, encryption, specification, listenBacklog, host, port) {
EndpointIp(type, DOMAIN_IPV6, protocol, encryption, specification, listenBacklog, host, port) {
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -45,6 +45,8 @@
#ifdef TRI_HAVE_WINSOCK2_H
#include <WinSock2.h>
#include <WS2tcpip.h>
#endif
@ -76,7 +78,7 @@ namespace triagens {
/// @brief endpoint types
////////////////////////////////////////////////////////////////////////////////
enum Type {
enum EndpointType {
ENDPOINT_SERVER,
ENDPOINT_CLIENT
};
@ -86,19 +88,17 @@ namespace triagens {
////////////////////////////////////////////////////////////////////////////////
enum DomainType {
ENDPOINT_UNKNOWN = 0,
#ifdef TRI_HAVE_LINUX_SOCKETS
ENDPOINT_UNIX,
#endif
ENDPOINT_IPV4,
ENDPOINT_IPV6
DOMAIN_UNKNOWN = 0,
DOMAIN_UNIX,
DOMAIN_IPV4,
DOMAIN_IPV6
};
////////////////////////////////////////////////////////////////////////////////
/// @brief protocols used for endpoints
////////////////////////////////////////////////////////////////////////////////
enum Protocol {
enum ProtocolType {
PROTOCOL_UNKNOWN,
PROTOCOL_HTTP
};
@ -107,7 +107,7 @@ namespace triagens {
/// @brief encryption used when talking to endpoint
////////////////////////////////////////////////////////////////////////////////
enum Encryption {
enum EncryptionType {
ENCRYPTION_NONE = 0,
ENCRYPTION_SSL
};
@ -131,10 +131,10 @@ namespace triagens {
/// @brief creates an endpoint
////////////////////////////////////////////////////////////////////////////////
Endpoint (const Type,
Endpoint (const EndpointType,
const DomainType,
const Protocol,
const Encryption,
const ProtocolType,
const EncryptionType,
const std::string&,
int);
@ -177,7 +177,7 @@ namespace triagens {
/// @brief creates an endpoint from a string value
////////////////////////////////////////////////////////////////////////////////
static Endpoint* factory (const Type type,
static Endpoint* factory (const EndpointType type,
const std::string&,
int);
@ -235,7 +235,7 @@ namespace triagens {
/// @brief get the type of an endpoint
////////////////////////////////////////////////////////////////////////////////
Type getType () const {
EndpointType getType () const {
return _type;
}
@ -251,7 +251,7 @@ namespace triagens {
/// @brief get the protocol of an endpoint
////////////////////////////////////////////////////////////////////////////////
Protocol getProtocol () const {
ProtocolType getProtocol () const {
return _protocol;
}
@ -259,7 +259,7 @@ namespace triagens {
/// @brief get the encryption used
////////////////////////////////////////////////////////////////////////////////
Encryption getEncryption () const {
EncryptionType getEncryption () const {
return _encryption;
}
@ -326,7 +326,7 @@ namespace triagens {
/// @brief endpoint type
////////////////////////////////////////////////////////////////////////////////
Type _type;
EndpointType _type;
////////////////////////////////////////////////////////////////////////////////
/// @brief endpoint domain type
@ -338,13 +338,13 @@ namespace triagens {
/// @brief protocol used
////////////////////////////////////////////////////////////////////////////////
Protocol _protocol;
ProtocolType _protocol;
////////////////////////////////////////////////////////////////////////////////
/// @brief encryption used
////////////////////////////////////////////////////////////////////////////////
Encryption _encryption;
EncryptionType _encryption;
////////////////////////////////////////////////////////////////////////////////
/// @brief original endpoint specification
@ -387,11 +387,11 @@ namespace triagens {
/// @brief creates an endpoint
////////////////////////////////////////////////////////////////////////////////
EndpointUnix (const Type,
const Protocol,
string const&,
EndpointUnix (const EndpointType,
const ProtocolType,
const std::string&,
int,
string const&);
const std::string&);
////////////////////////////////////////////////////////////////////////////////
/// @brief destroys an endpoint
@ -514,13 +514,13 @@ namespace triagens {
/// @brief creates an endpoint
////////////////////////////////////////////////////////////////////////////////
EndpointIp (const Type,
EndpointIp (const EndpointType,
const DomainType,
const Protocol,
const Encryption,
string const&,
const ProtocolType,
const EncryptionType,
const std::string&,
int,
string const&,
const std::string&,
const uint16_t);
public:
@ -625,7 +625,7 @@ namespace triagens {
/// @brief get host
////////////////////////////////////////////////////////////////////////////////
string getHost () const {
std::string getHost () const {
return _host;
}
@ -633,7 +633,7 @@ namespace triagens {
/// @brief get host strin for HTTP requests
////////////////////////////////////////////////////////////////////////////////
string getHostString () const {
std::string getHostString () const {
return _host + ':' + triagens::basics::StringUtils::itoa(_port);
}
@ -656,7 +656,7 @@ namespace triagens {
/// @brief host name / address (IPv4 or IPv6)
////////////////////////////////////////////////////////////////////////////////
string _host;
std::string _host;
////////////////////////////////////////////////////////////////////////////////
/// @brief port number
@ -691,12 +691,12 @@ namespace triagens {
/// @brief creates an endpoint
////////////////////////////////////////////////////////////////////////////////
EndpointIpV4 (const Type,
const Protocol,
const Encryption,
string const&,
EndpointIpV4 (const EndpointType,
const ProtocolType,
const EncryptionType,
const std::string&,
int,
string const&,
const std::string&,
const uint16_t);
////////////////////////////////////////////////////////////////////////////////
@ -755,12 +755,12 @@ namespace triagens {
/// @brief creates an endpoint
////////////////////////////////////////////////////////////////////////////////
EndpointIpV6 (const Type,
const Protocol,
const Encryption,
string const&,
EndpointIpV6 (const EndpointType,
const ProtocolType,
const EncryptionType,
const std::string&,
int,
string const&,
const std::string&,
const uint16_t);
////////////////////////////////////////////////////////////////////////////////

View File

@ -83,7 +83,9 @@ EndpointList::~EndpointList () {
/// @brief count the number of elements in a sub-list
////////////////////////////////////////////////////////////////////////////////
size_t EndpointList::count (const Endpoint::Protocol protocol, const Endpoint::Encryption encryption) const {
size_t EndpointList::count (const Endpoint::ProtocolType protocol,
const Endpoint::EncryptionType encryption) const {
map<string, ListType>::const_iterator i = _lists.find(getKey(protocol, encryption));
if (i == _lists.end()) {
@ -108,7 +110,9 @@ void EndpointList::dump () const {
/// @brief return all endpoints for a specific protocol
////////////////////////////////////////////////////////////////////////////////
EndpointList::ListType EndpointList::getEndpoints (const Endpoint::Protocol protocol, const Endpoint::Encryption encryption) const {
EndpointList::ListType EndpointList::getEndpoints (const Endpoint::ProtocolType protocol,
const Endpoint::EncryptionType encryption) const {
EndpointList::ListType result;
map<string, EndpointList::ListType>::const_iterator i = _lists.find(getKey(protocol, encryption));
@ -125,7 +129,9 @@ EndpointList::ListType EndpointList::getEndpoints (const Endpoint::Protocol prot
/// @brief adds an endpoint for a specific protocol
////////////////////////////////////////////////////////////////////////////////
bool EndpointList::addEndpoint (const Endpoint::Protocol protocol, const Endpoint::Encryption encryption, Endpoint* endpoint) {
bool EndpointList::addEndpoint (const Endpoint::ProtocolType protocol,
const Endpoint::EncryptionType encryption, Endpoint* endpoint) {
_lists[getKey(protocol, encryption)].insert(endpoint);
return true;

View File

@ -102,8 +102,8 @@ namespace triagens {
// --SECTION-- private methods
// -----------------------------------------------------------------------------
static const string getKey (const Endpoint::Protocol protocol,
const Endpoint::Encryption encryption) {
static const string getKey (const Endpoint::ProtocolType protocol,
const Endpoint::EncryptionType encryption) {
return string(getProtocolName(protocol) + " " + getEncryptionName(encryption));
}
@ -123,7 +123,7 @@ namespace triagens {
/// @brief return a protocol name
////////////////////////////////////////////////////////////////////////////////
static const string getProtocolName (const Endpoint::Protocol protocol) {
static const string getProtocolName (const Endpoint::ProtocolType protocol) {
switch (protocol) {
case Endpoint::PROTOCOL_HTTP:
return "http";
@ -136,7 +136,7 @@ namespace triagens {
/// @brief return a encryption name
////////////////////////////////////////////////////////////////////////////////
static const string getEncryptionName (const Endpoint::Encryption encryption) {
static const string getEncryptionName (const Endpoint::EncryptionType encryption) {
switch (encryption) {
case Endpoint::ENCRYPTION_SSL:
return "ssl";
@ -150,7 +150,7 @@ namespace triagens {
/// @brief count the number of elements in a sub-list
////////////////////////////////////////////////////////////////////////////////
size_t count (const Endpoint::Protocol, const Endpoint::Encryption) const;
size_t count (const Endpoint::ProtocolType, const Endpoint::EncryptionType) const;
////////////////////////////////////////////////////////////////////////////////
/// @brief dump all used endpoints
@ -162,13 +162,13 @@ namespace triagens {
/// @brief return all endpoints for a specific protocol
////////////////////////////////////////////////////////////////////////////////
ListType getEndpoints (const Endpoint::Protocol, const Endpoint::Encryption) const;
ListType getEndpoints (const Endpoint::ProtocolType, const Endpoint::EncryptionType) const;
////////////////////////////////////////////////////////////////////////////////
/// @brief adds an endpoint for a specific protocol
////////////////////////////////////////////////////////////////////////////////
bool addEndpoint (const Endpoint::Protocol, const Endpoint::Encryption, Endpoint*);
bool addEndpoint (const Endpoint::ProtocolType, const Endpoint::EncryptionType, Endpoint*);
////////////////////////////////////////////////////////////////////////////////
/// @}