mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 10:09:36 +02:00
add JSONFormatter
This commit is contained in:
48
Foundation/include/Poco/JSONString.h
Normal file
48
Foundation/include/Poco/JSONString.h
Normal file
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// JSONString.h
|
||||
//
|
||||
// $Id: //poco/1.4/Foundation/include/Poco/JSONString.h#1 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: String
|
||||
//
|
||||
// JSONString utility functions.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_JSONString_INCLUDED
|
||||
#define Foundation_JSONString_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
std::string Foundation_API toJSON(char c);
|
||||
/// Utility function for escaping JSON characters.
|
||||
|
||||
|
||||
void Foundation_API toJSON(const std::string& value, std::ostream& out, bool wrap = true);
|
||||
/// Formats string value into the suplied output stream by
|
||||
/// escaping control characters.
|
||||
/// If wrap is true, the resulting string is enclosed in double quotes
|
||||
|
||||
|
||||
std::string Foundation_API toJSON(const std::string& value, bool wrap = true);
|
||||
/// Formats string value by escaping control characters.
|
||||
/// If wrap is true, the resulting string is enclosed in double quotes
|
||||
/// Returns formatted string.
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_JSONString_INCLUDED
|
||||
Reference in New Issue
Block a user