index
:
minetest.git
gpcf
lifo-fixes
release
modified minetest for gpcfs purposes
gpcf
about
summary
refs
log
tree
commit
diff
log msg
author
committer
range
Mode
Name
Size
-rw-r--r--
.clang-format
733
log
plain
-rw-r--r--
.clang-tidy
507
log
plain
-rw-r--r--
.gitattributes
28
log
plain
d---------
.github
45
log
plain
-rw-r--r--
.gitignore
1670
log
plain
-rw-r--r--
.gitlab-ci.yml
9520
log
plain
-rw-r--r--
.mailmap
2087
log
plain
-rw-r--r--
.travis.yml
2754
log
plain
-rw-r--r--
CMakeLists.txt
11368
log
plain
-rw-r--r--
CONTRIBUTING.md
6745
/*
Minetest-c55
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
"serialize.h"
#include <sstream>
#include <iomanip>
// Creates a string encoded in JSON format (almost equivalent to a C string literal)
std
::
string
serializeJsonString
(
const
std
::
string
&
plain
)
{
std
::
ostringstream
os
(
std
::
ios
::
binary
);
os
<<
"
\"
"
;
for
(
size_t
i
=
0
;
i
<
plain
.
size
();
i
++)
{
char
c
=
plain
[
i
];
switch
(
c
)
{
case
'"'
:
os
<<
"
\\\"
"
;
break
;
case
'
\\
'
:
os
<<
"
\\\\
"
;
break
;
case
'/'
:
os
<<
"
\\
/"
;
break
;st.git/plain/cmake?h=release&id=76325d0ba925cfdd18e387ae96d27921136e98e5'>plain
d---------
doc
585
log
plain
d---------
fonts
1835
log
plain
d---------
games
/
minimal
34
log
plain
d---------
lib
94
log
plain
-rw-r--r--
minetest.conf.example
87684
log
plain
d---------
misc
669
log
plain
d---------
mods
41
log
plain
d---------
po
1128
log
plain
d---------
src
6891
log
plain
d---------
textures
81
log
plain
d---------
util
288
log
plain