JSBSim Flight Dynamics Model 1.2.3 (07 Jun 2025)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
simgear Namespace Reference

Utility function for creation of a child property node using a relative path. More...

Namespaces

namespace  props
 Property value types.
 

Functions

template<typename StringType >
SGPropertyNodemakeNode (SGPropertyNode *parent, const StringType &name)
 
template<typename T >
parseString (const std::string &str)
 Parse a string as an object of a given type.
 
template<typename T >
std::istream & readFrom (std::istream &stream, T &result)
 

Detailed Description

Utility function for creation of a child property node using a relative path.

Function Documentation

◆ makeNode()

template<typename StringType >
SGPropertyNode * makeNode ( SGPropertyNode parent,
const StringType &  name 
)
inline

Definition at line 2052 of file props.hxx.

2053{
2054 return parent->getNode(name, true);
2055}
SGPropertyNode * getNode(const char *relative_path, bool create=false)
Get a pointer to another node by relative path.

◆ parseString()

template<typename T >
T parseString ( const std::string &  str)
inline

Parse a string as an object of a given type.

XXX no error behavior yet.

Template Parameters
Tthe return type
Parameters
strthe string
Returns
the object.

Definition at line 97 of file props.hxx.

98{
99 std::istringstream stream(str);
100 T result;
101 readFrom(stream, result);
102 return result;
103}

◆ readFrom()

template<typename T >
std::istream & readFrom ( std::istream &  stream,
T &  result 
)

Definition at line 82 of file props.hxx.

83{
84 stream >> result;
85 return stream;
86}