1//
2// JSONString.h
3//
4// Library: Foundation
5// Package: Core
6// Module: String
7//
8// JSONString utility functions.
9//
10// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
11// and Contributors.
12//
13// SPDX-License-Identifier: BSL-1.0
14//
15
16
17#ifndef Foundation_JSONString_INCLUDED
18#define Foundation_JSONString_INCLUDED
19
20
21#include "Poco/Foundation.h"
22
23
24namespace Poco {
25
26
27void Foundation_API toJSON(const std::string& value, std::ostream& out, bool wrap = true);
28 /// Formats string value into the supplied output stream by
29 /// escaping control characters.
30 /// If wrap is true, the resulting string is enclosed in double quotes
31
32std::string Foundation_API toJSON(const std::string& value, bool wrap = true);
33 /// Formats string value by escaping control characters.
34 /// If wrap is true, the resulting string is enclosed in double quotes
35 /// Returns formatted string.
36
37
38} // namespace Poco
39
40
41#endif // Foundation_JSONString_INCLUDED
42