Debian Codegraph @

packages/seacas/libraries/ioss/src/visualization/catalyst/parser/PhactoriParserInterface.cxx

raw
1 // Copyright(C) 1999-2021 National Technology & Engineering Solutions
2 // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 // NTESS, the U.S. Government retains certain rights in this software.
4 //
5 // See packages/seacas/LICENSE for details
6
7 #include "PhactoriParserInterface.h"
8 #include <iostream>
9 #include <fstream>
10 #include <sstream>
11
12 namespace Iovs {
13
14 void parsePhactoriString(const std::string & s,
15 PhactoriParserInterface::ParseInfo & pinfo);
16
17 void PhactoriParserInterface::parseFile(const std::string & filepath,
18 ParseInfo & pinfo) {
19
20 std::ifstream f(filepath);
21 if (f) {
22 std::ostringstream ss;
23 ss << f.rdbuf();
24 parsePhactoriString(ss.str(), pinfo);
25 }
26 else {
27 std::cerr << "Unable to open file for parsing: " << filepath << "\n";
28 }
29 }
30
31 void PhactoriParserInterface::parseString(const std::string & s,
32 ParseInfo & pinfo) {
33 parsePhactoriString(s, pinfo);
34 }
35
36 } // namespace Iovs