JSON for Modern C++  3.0
template<template< typename U, typename V, typename...Args > class ObjectType = std::map, template< typename U, typename...Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = int64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator>
string_t nlohmann::basic_json::lexer::get_string ( ) const
inline

The function iterates the characters between the opening and closing quotes of the string value. The complete string is the range [m_start,m_cursor). Consequently, we iterate from m_start+1 to m_cursor-1.

We differentiate two cases:

  1. Escaped characters. In this case, a new character is constructed according to the nature of the escape. Some escapes create new characters (e.g., "\\n" is replaced by "\n"), some are copied as is (e.g., "\\\\"). Furthermore, Unicode escapes of the shape "\\uxxxx" need special care. In this case, to_unicode takes care of the construction of the values.
  2. Unescaped characters are copied as is.
Returns
string value of current token without opening and closing quotes
Exceptions
std::out_of_rangeif to_unicode fails