This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
json-api: add location array to error and warning objects
- Loading branch information
Showing
6 changed files
with
66 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2016-2018 Doug Moen | ||
// Licensed under the Apache License, version 2.0 | ||
// See accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
#include <libcurv/json.h> | ||
|
||
namespace curv { | ||
|
||
void write_json_string(const char* str, std::ostream& out) | ||
{ | ||
out << '"'; | ||
for (const char* p = str; *p != '\0'; ++p) { | ||
if (*p == '\\' || *p == '"') | ||
out << '\\'; | ||
out << *p; | ||
} | ||
out << '"'; | ||
} | ||
|
||
} // namespace curv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2016-2018 Doug Moen | ||
// Licensed under the Apache License, version 2.0 | ||
// See accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
#ifndef LIBCURV_JSON_H | ||
#define LIBCURV_JSON_H | ||
|
||
#include <ostream> | ||
|
||
namespace curv { | ||
|
||
void write_json_string(const char*, std::ostream&); | ||
|
||
} // namespace curv | ||
#endif // header guard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters