ewmscp  ..
Public Member Functions | Friends | List of all members
modeBitType Class Reference

wrapper for mode_t. More...

#include <ewmscp.h>

Inheritance diagram for modeBitType:
[legend]
Collaboration diagram for modeBitType:
[legend]

Public Member Functions

 modeBitType (unsigned int aBits=0)
 
- Public Member Functions inherited from options::fundamental_wrapper< mode_t >
 fundamental_wrapper ()
 
 fundamental_wrapper (mode_t aValue)
 
fundamental_wrapperoperator= (const mode_t aValue)
 
mode_t operator= (const mode_t &aValue)
 
 operator mode_t & ()
 
 operator const mode_t & () const
 

Friends

std::ostream & operator<< (std::ostream &out, const modeBitType &item)
 
std::istream & operator>> (std::istream &in, modeBitType &item)
 

Additional Inherited Members

- Protected Attributes inherited from options::fundamental_wrapper< mode_t >
mode_t lValue
 

Detailed Description

wrapper for mode_t.

This wrapper uses options::fundamental_wrapper<T> so that the wrappered fundamental type mode_t can be used as a class and extends it by adding IO-operators to read/print it as octal value, the customary representation of unic mode bits.

Definition at line 52 of file ewmscp.h.

Constructor & Destructor Documentation

◆ modeBitType()

modeBitType::modeBitType ( unsigned int  aBits = 0)
inline

Definition at line 54 of file ewmscp.h.

54 : fundamental_wrapper(aBits) {};

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const modeBitType item 
)
friend

Definition at line 55 of file ewmscp.h.

55  {
56  const mode_t& bits(item);
57  auto flags = out.flags();
58  out << std::oct << bits;
59  out.flags(flags);
60  return out;
61  }

◆ operator>>

std::istream& operator>> ( std::istream &  in,
modeBitType item 
)
friend

Definition at line 62 of file ewmscp.h.

62  {
63  mode_t& bits(item);
64  auto flags = in.flags();
65  in >> std::oct >> bits;
66  in.flags(flags);
67  return in;
68  }

The documentation for this class was generated from the following file:
options::fundamental_wrapper< mode_t >::fundamental_wrapper
fundamental_wrapper()
Definition: Options.h:86