xml_file.cpp
1 /*
2  * This file is part of CasADi.
3  *
4  * CasADi -- A symbolic framework for dynamic optimization.
5  * Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl,
6  * KU Leuven. All rights reserved.
7  * Copyright (C) 2011-2014 Greg Horn
8  *
9  * CasADi is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 3 of the License, or (at your option) any later version.
13  *
14  * CasADi is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with CasADi; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  */
24 
25 
26 #include "xml_file_internal.hpp"
27 
28 namespace casadi {
29 
31 }
32 
33 XmlFile::XmlFile(const std::string& name) {
34  own(XmlFileInternal::getPlugin(name).creator());
35 }
36 
38 }
39 
41  return static_cast<const XmlFileInternal*>(SharedObject::operator->());
42 }
43 
45  return static_cast<XmlFileInternal*>(SharedObject::operator->());
46 }
47 
48 XmlNode XmlFile::parse(const std::string& filename) {
49  return (*this)->parse(filename);
50 }
51 
52 void XmlFile::dump(const std::string& filename, const XmlNode& node) {
53  return (*this)->dump(filename, node);
54 }
55 
56 void XmlFile::load_plugin(const std::string& name) {
58 }
59 
60 std::string XmlFile::doc(const std::string& name) {
61  return XmlFileInternal::getPlugin(name).doc;
62 }
63 
64 } // namespace casadi
SharedObjectInternal * operator->() const
Access a member function or object.
static Plugin & getPlugin(const std::string &pname)
Load and get the creator function.
static Plugin load_plugin(const std::string &pname, bool register_plugin=true, bool needs_lock=true)
Load a plugin dynamically.
static std::string doc(const std::string &name)
Get solver specific documentation.
Definition: xml_file.cpp:60
void dump(const std::string &filename, const XmlNode &node)
Definition: xml_file.cpp:52
XmlNode parse(const std::string &filename)
Definition: xml_file.cpp:48
static void load_plugin(const std::string &name)
Load a plugin dynamically.
Definition: xml_file.cpp:56
XmlFileInternal * operator->()
Access functions of the node.
Definition: xml_file.cpp:44
The casadi namespace.
Definition: archiver.cpp:28
std::string filename(const std::string &path)
Definition: ghc.cpp:55