Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI_externalFile.cc
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright 2019, Lawrence Livermore National Security, LLC.
4# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6# SPDX-License-Identifier: MIT
7# <<END-copyright>>
8*/
9
10#include <stdlib.h>
11#include "GIDI.hpp"
12
13namespace GIDI {
14
15/*! \class ExternalFile
16 * This class represents the **GNDS** <**externalFile**> node.
17 */
18
19/* *********************************************************************************************************//**
20 ***********************************************************************************************************/
21
22ExternalFile::ExternalFile( std::string const &a_label, std::string const &a_path ) :
24 m_path( a_path ) {
25
26}
27
28/* *********************************************************************************************************//**
29 * @param a_node [in] The **HAPI::Node** to be parsed to construct a GeneralEvaporation2d instance.
30 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
31 * @param a_parent [in] The parent GIDI::Suite.
32 ***********************************************************************************************************/
33
34ExternalFile::ExternalFile( HAPI::Node const &a_node, SetupInfo &a_setupInfo, LUPI_maybeUnused GIDI::Suite *a_parent ) :
35 Form( a_node, a_setupInfo, FormType::externalFile ),
36 m_path( a_node.attribute_as_string( GIDI_pathChars ) ) {
37
38}
39
40/* *********************************************************************************************************//**
41 ***********************************************************************************************************/
42
46
47/* *********************************************************************************************************//**
48 * Fills the argument *a_writeInfo* with the XML line that represent *this*.
49 *
50 * @param a_writeInfo [in/out] Instance containing incremental indentation and other information and stores the appended lines.
51 * @param a_indent [in] The amount to indent *this* node.
52 ***********************************************************************************************************/
53
54void ExternalFile::toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent ) const {
55
56 std::string attributes;
57
58 attributes = a_writeInfo.addAttribute( GIDI_labelChars, label( ) );
59 attributes += a_writeInfo.addAttribute( GIDI_pathChars, path( ) );
60
61 a_writeInfo.addNodeStarterEnder( a_indent, moniker( ), attributes );
62}
63
64} // End of namespace GIDI.
#define GIDI_externalFileChars
Definition GIDI.hpp:173
#define GIDI_pathChars
Definition GIDI.hpp:450
#define GIDI_labelChars
Definition GIDI.hpp:438
#define LUPI_maybeUnused
std::string const & path() const
Definition GIDI.hpp:3039
ExternalFile(std::string const &a_label, std::string const &a_path)
void toXMLList(GUPI::WriteInfo &a_writeInfo, std::string const &a_indent="") const
std::string const & label() const
Definition GIDI.hpp:658
Form(FormType a_type)
Definition GIDI_form.cc:25
std::string const & moniker() const
Definition GUPI.hpp:102
void addNodeStarterEnder(std::string const &indent, std::string const &a_moniker, std::string const &a_attributes="")
Definition GUPI.hpp:57
std::string addAttribute(std::string const &a_name, std::string const &a_value) const
Definition GUPI.hpp:60
Definition GIDI.hpp:32
FormType
Definition GIDI.hpp:118