diff options
author | montellese <montellese@xbmc.org> | 2011-06-03 16:25:07 +0200 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2011-06-03 16:25:07 +0200 |
commit | 3565ad579e9b80f4be57db901d3fe44d9bfac87d (patch) | |
tree | 23b7218b1aacdbd6e3299a614ce8073ae93cc86f /lib/jsoncpp/src/lib_json/json_tool.h | |
parent | 648af1e56953eb1c9aeeebfc5826c6a828d4ebbb (diff) | |
parent | fee62a4d040f6eb3e44e703f2f80846a6aaa57ea (diff) |
replace jsoncpp with yajl (thanks topfs2)
* topfs2/remove_jsoncpp: (21 commits)
Fix. Added explicit typecast to platform int to quench warnings for variant use in jsonrpc
[win32] replace jsoncpp with yajl
Removed jsoncpp
Added pragma and license to IClient.h
Removed the dependency of jsoncpp in CVariant
Switched to use CVariant instead of jsoncpp values in JSON-RPC
Added yajl writer for Variant
Added yajl parser for Variant
Added c_str and have size of variant work with strings
Added check for libyajl to configure
Added CVariant::type which returns the type of the current variant (easier than multiple isFoo queries)
Switched Variant to use double internally, still accepts floats
Added swap method to CVariant
Moved to use explicit type in CVariant instead of isFoo
Added operator== to CVariant
Added array and map iterators to CVariant
Added CVariant constructor which takes a string pointer and length
Added append to CVariant
Added isMember to CVariant
Removed debug in CVariant
...
Conflicts:
Makefile.in
configure.in
project/VS2010Express/XBMC.vcxproj
xbmc/interfaces/json-rpc/AudioLibrary.cpp
xbmc/interfaces/json-rpc/FileItemHandler.cpp
xbmc/interfaces/json-rpc/FileItemHandler.h
xbmc/interfaces/json-rpc/VideoLibrary.cpp
Diffstat (limited to 'lib/jsoncpp/src/lib_json/json_tool.h')
-rw-r--r-- | lib/jsoncpp/src/lib_json/json_tool.h | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/lib/jsoncpp/src/lib_json/json_tool.h b/lib/jsoncpp/src/lib_json/json_tool.h deleted file mode 100644 index 658031bbba..0000000000 --- a/lib/jsoncpp/src/lib_json/json_tool.h +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED -# define LIB_JSONCPP_JSON_TOOL_H_INCLUDED - -/* This header provides common string manipulation support, such as UTF-8, - * portable conversion from/to string... - * - * It is an internal header that must not be exposed. - */ - -namespace Json { - -/// Converts a unicode code-point to UTF-8. -static inline std::string -codePointToUTF8(unsigned int cp) -{ - std::string result; - - // based on description from http://en.wikipedia.org/wiki/UTF-8 - - if (cp <= 0x7f) - { - result.resize(1); - result[0] = static_cast<char>(cp); - } - else if (cp <= 0x7FF) - { - result.resize(2); - result[1] = static_cast<char>(0x80 | (0x3f & cp)); - result[0] = static_cast<char>(0xC0 | (0x1f & (cp >> 6))); - } - else if (cp <= 0xFFFF) - { - result.resize(3); - result[2] = static_cast<char>(0x80 | (0x3f & cp)); - result[1] = 0x80 | static_cast<char>((0x3f & (cp >> 6))); - result[0] = 0xE0 | static_cast<char>((0xf & (cp >> 12))); - } - else if (cp <= 0x10FFFF) - { - result.resize(4); - result[3] = static_cast<char>(0x80 | (0x3f & cp)); - result[2] = static_cast<char>(0x80 | (0x3f & (cp >> 6))); - result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 12))); - result[0] = static_cast<char>(0xF0 | (0x7 & (cp >> 18))); - } - - return result; -} - - -/// Returns true if ch is a control character (in range [0,32[). -static inline bool -isControlCharacter(char ch) -{ - return ch > 0 && ch <= 0x1F; -} - - -enum { - /// Constant that specify the size of the buffer that must be passed to uintToString. - uintToStringBufferSize = 3*sizeof(LargestUInt)+1 -}; - -// Defines a char buffer for use with uintToString(). -typedef char UIntToStringBuffer[uintToStringBufferSize]; - - -/** Converts an unsigned integer to string. - * @param value Unsigned interger to convert to string - * @param current Input/Output string buffer. - * Must have at least uintToStringBufferSize chars free. - */ -static inline void -uintToString( LargestUInt value, - char *¤t ) -{ - *--current = 0; - do - { - *--current = char(value % 10) + '0'; - value /= 10; - } - while ( value != 0 ); -} - -} // namespace Json { - -#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED |