JSBSim Flight Dynamics Model 1.3.0 (09 Apr 2026)
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 2045 of file props.hxx.

2046{
2047 return parent->getNode(name, true);
2048}
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 90 of file props.hxx.

91{
92 std::istringstream stream(str);
93 T result;
94 readFrom(stream, result);
95 return result;
96}

◆ readFrom()

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

Definition at line 75 of file props.hxx.

76{
77 stream >> result;
78 return stream;
79}