1
0
Fork 0

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

This commit is contained in:
Heiko Kernbach 2014-04-23 12:27:10 +02:00
commit eb5de72025
5 changed files with 19 additions and 33 deletions

View File

@ -489,7 +489,7 @@ void ArangoClient::printErrLine (const string& s) {
void ArangoClient::_printLine(const string &s) {
#ifdef _WIN32
LPWSTR wBuf = (LPWSTR)TRI_Allocate(TRI_CORE_MEM_ZONE, (sizeof WCHAR)* (s.size() + 1), true);
LPWSTR wBuf = (LPWSTR) TRI_Allocate(TRI_CORE_MEM_ZONE, (sizeof WCHAR)* (s.size() + 1), true);
int wLen = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, wBuf, (int) ((sizeof WCHAR) * (s.size() + 1)));
if (wLen) {
@ -500,11 +500,6 @@ void ArangoClient::_printLine(const string &s) {
pos = bufferInfo.dwCursorPosition;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
WriteConsoleOutputCharacterW(GetStdHandle(STD_OUTPUT_HANDLE), wBuf, (DWORD) s.size(), pos, &n);
// Workaround recomended by
// http://social.msdn.microsoft.com/Forums/de-DE/c16846a3-eb27-4698-80a5-6c4ecf92a799/aus-der-msdnhotline-deutsche-umlaute-in-der-console-anzeigen-standard-c?forum=visualcplusde
// but it does not work
// std::locale::global(std::locale("German_germany"));
// std::cout << "esteban: " << s;
}
else {
fprintf(stdout, "window error: '%d' \r\n", GetLastError());
@ -519,12 +514,12 @@ void ArangoClient::_printLine(const string &s) {
void ArangoClient::printLine (const string& s, bool forceNewLine) {
#ifdef _WIN32
// no, we can use std::cout as this doesn't support UTF-8 on Windows
// no, we cannot use std::cout as this doesn't support UTF-8 on Windows
//fprintf(stdout, "%s\r\n", s.c_str());
TRI_vector_string_t subStrings = TRI_SplitString(s.c_str(), '\n');
bool hasNewLines = (s.find("\n") != string::npos) | forceNewLine;
if (hasNewLines) {
for (int i = 0; i < subStrings._length; i++) {
for (size_t i = 0; i < subStrings._length; i++) {
_printLine(subStrings._buffer[i]);
_newLine();
}
@ -539,13 +534,15 @@ void ArangoClient::printLine (const string& s, bool forceNewLine) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief prints a string to stdout, without a newline
/// @brief prints a string to stdout, without a newline (Non-Windows only)
/// on Windows, we'll print the line and a newline
////////////////////////////////////////////////////////////////////////////////
void ArangoClient::printContinuous (const string& s) {
// no, we can use std::cout as this doesn't support UTF-8 on Windows
// no, we cannot use std::cout as this doesn't support UTF-8 on Windows
#ifdef _WIN32
printLine(s);
// On Windows, we just print the line followed by a newline
printLine(s, true);
#else
fprintf(stdout, "%s", s.c_str());
fflush(stdout);

View File

@ -6,7 +6,7 @@ dnl ============================================================================
dnl --SECTION-- triAGENS GmbH Build Environment
dnl ============================================================================
AC_INIT([triAGENS ArangoDB], [2.1.0-devel], [info@triagens.de], [arangodb], [http://www.arangodb.org])
AC_INIT([triAGENS ArangoDB], [2.1.4-devel], [info@triagens.de], [arangodb], [http://www.arangodb.org])
dnl ----------------------------------------------------------------------------
dnl auxillary directory for install-sh and missing

View File

@ -34,26 +34,6 @@
},
toString: function (v) {
return v.major + '.' + v.minor + '.' + v.patch;
},
toStringMainLine: function (v) {
return v.major + '.' + v.minor;
},
compareVersions: function (l, r) {
if (l.major === r.major) {
if (l.minor === r.minor) {
if (l.patch === r.patch) {
return 0;
}
return l.patch - r.patch;
}
return l.minor - r.minor;
}
return l.major - r.major;
},
compareVersionStrings: function (l, r) {
l = window.versionHelper.fromString(l);
r = window.versionHelper.fromString(r);
return window.versionHelper.compareVersions(l, r);
}
};

View File

@ -84,7 +84,10 @@
queryObj = {
query: query,
bindVars: bindVars
bindVars: bindVars,
options: {
fullCount: true
}
};
$.ajax({
cache: false,

View File

@ -56,4 +56,10 @@ describe("Arango Helper", function() {
});
describe("checking html escaping", function() {
var input = "<&>\"'",
expected = "&lt;&amp;&gt;&quot;&#39;";
expect(arangoHelper.escapeHtml(input)).toEqual(expected);
});
});