Skip to content

Commit fac0e47

Browse files
committed
Added json ReaderWriter to default vsg::read() support
1 parent d4a914c commit fac0e47

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

include/vsg/io/json.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2929
namespace vsg
3030
{
3131

32-
// json parser based on spec: https://www.json.org/json-en.html
32+
/// json parser based on spec: https://www.json.org/json-en.html
3333
struct JSONParser
3434
{
3535
std::string buffer;
@@ -51,7 +51,6 @@ namespace vsg
5151
};
5252
VSG_type_name(vsg::JSONParser)
5353

54-
5554
/// json ReaderWriter
5655
class json : public vsg::Inherit<vsg::ReaderWriter, json>
5756
{
@@ -71,4 +70,3 @@ namespace vsg
7170
VSG_type_name(vsg::json)
7271

7372
}
74-

src/vsg/io/read.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
1212

1313
#include <vsg/io/VSG.h>
1414
#include <vsg/io/glsl.h>
15+
#include <vsg/io/json.h>
1516
#include <vsg/io/read.h>
1617
#include <vsg/io/spirv.h>
1718
#include <vsg/io/tile.h>
@@ -50,6 +51,11 @@ ref_ptr<Object> vsg::read(const Path& filename, ref_ptr<const Options> options)
5051
spirv rw;
5152
return rw.read(filename, options);
5253
}
54+
else if (ext == ".json")
55+
{
56+
json rw;
57+
return rw.read(filename, options);
58+
}
5359
else if (glsl::extensionSupported(ext))
5460
{
5561
glsl rw;

0 commit comments

Comments
 (0)