Jpp 21.0.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JEEP::JPropertiesTemplateElement< JProperties > Class Reference

Template specialisation for JProperties. More...

#include <JProperties.hh>

Inheritance diagram for JEEP::JPropertiesTemplateElement< JProperties >:
JEEP::JPropertiesElementInterface JLANG::JStreamInput JLANG::JStreamOutput JLANG::JStreamSuffixOutput

Public Member Functions

 JPropertiesTemplateElement (const JProperties &value)
 Constructor.
 
virtual std::istream & read (std::istream &in) override
 Stream input.
 
virtual std::ostream & write (std::ostream &out, const char *prefix, const char postfix) const override
 Stream output.
 
virtual std::ostream & write (std::ostream &out) const override
 Stream output.
 
virtual bool is_properties () const override
 Get properties type.
 
virtual bool equals (const JPropertiesElementInterface &element) const
 Equality between property element interfaces.
 

Private Attributes

JProperties object
 

Detailed Description

Template specialisation for JProperties.

Definition at line 1005 of file JProperties.hh.

Constructor & Destructor Documentation

◆ JPropertiesTemplateElement()

JEEP::JPropertiesTemplateElement< JProperties >::JPropertiesTemplateElement ( const JProperties & value)
inline

Constructor.

Parameters
valuereference of template bject

Definition at line 1014 of file JProperties.hh.

1014 :
1015 JPropertiesElementInterface(),
1016 object(value)
1017 {}

Member Function Documentation

◆ read()

virtual std::istream & JEEP::JPropertiesTemplateElement< JProperties >::read ( std::istream & in)
inlineoverridevirtual

Stream input.

Parameters
ininput stream
Returns
input stream

Implements JLANG::JStreamInput.

Definition at line 1026 of file JProperties.hh.

1027 {
1028 object.read(in);
1029
1030 return in;
1031 }

◆ write() [1/2]

virtual std::ostream & JEEP::JPropertiesTemplateElement< JProperties >::write ( std::ostream & out,
const char * prefix,
const char postfix ) const
inlineoverridevirtual

Stream output.

Parameters
outoutput stream
prefixprefix
postfixpostfix
Returns
output stream

Reimplemented from JEEP::JPropertiesElementInterface.

Definition at line 1042 of file JProperties.hh.

1045 {
1046 using namespace std;
1047
1048 for (JProperties::const_iterator i = object.begin(); i != object.end(); ++i) {
1049
1050 char c = ' ';
1051
1052 if (i->second->is_properties()) {
1053 c = object.getDefaultDivision ();
1054 } else {
1055 c = object.getDefaultSeparator();
1056 }
1057
1058 i->second->write(out, (prefix + i->first + c).c_str(), postfix);
1059 }
1060
1061 out << flush;
1062
1063 return out;
1064 }

◆ write() [2/2]

virtual std::ostream & JEEP::JPropertiesTemplateElement< JProperties >::write ( std::ostream & out) const
inlineoverridevirtual

Stream output.

Parameters
outoutput stream
Returns
output stream

Reimplemented from JEEP::JPropertiesElementInterface.

Definition at line 1073 of file JProperties.hh.

1074 {
1075 return writeObject(out, object);
1076 }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.

◆ is_properties()

virtual bool JEEP::JPropertiesTemplateElement< JProperties >::is_properties ( ) const
inlineoverridevirtual

Get properties type.

Returns
true

Reimplemented from JEEP::JPropertiesElementInterface.

Definition at line 1084 of file JProperties.hh.

1085 {
1086 return true;
1087 }

◆ equals()

virtual bool JEEP::JPropertiesElementInterface::equals ( const JPropertiesElementInterface & element) const
inlinevirtualinherited

Equality between property element interfaces.

Parameters
elementproperties element interface
Returns
false

Reimplemented in JEEP::JPropertiesTemplateElement< T >, and JEEP::JPropertiesTemplateElement< const T >.

Definition at line 95 of file JProperties.hh.

96 {
97 return false;
98 }

Member Data Documentation

◆ object

Definition at line 1091 of file JProperties.hh.


The documentation for this class was generated from the following file: