ewmscp  ..
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
maskName Class Reference
Collaboration diagram for maskName:
[legend]

Static Public Member Functions

static void print (std::ostream &out, uint32_t mask)
 
static uint32_t maskFromList (const options::container< std::string > &list)
 
static void addToRange (options::container< std::string > &opt)
 

Private Member Functions

 maskName (uint32_t aBits, const std::string &aName)
 

Static Private Member Functions

static const std::array< maskName, 16 > maskNames ()
 

Private Attributes

const uint32_t bits
 
const std::string name
 

Detailed Description

Definition at line 66 of file inotify_watch.cpp.

Constructor & Destructor Documentation

◆ maskName()

maskName::maskName ( uint32_t  aBits,
const std::string &  aName 
)
inlineprivate

Definition at line 69 of file inotify_watch.cpp.

69 : bits(aBits), name(aName){};

Member Function Documentation

◆ addToRange()

static void maskName::addToRange ( options::container< std::string > &  opt)
inlinestatic

Definition at line 115 of file inotify_watch.cpp.

115  {
116  for (const auto& item : maskNames()) {
117  opt.fAddToRange(item.name);
118  }
119  };

References options::internal::typed_base< T, forceRangeValueTypeString >::fAddToRange(), and maskNames().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ maskFromList()

static uint32_t maskName::maskFromList ( const options::container< std::string > &  list)
inlinestatic

Definition at line 104 of file inotify_watch.cpp.

104  {
105  uint32_t mask = 0;
106  for (const auto& listItem : list) {
107  for (const auto& item : maskNames()) {
108  if (item.name == listItem) {
109  mask |= item.bits;
110  }
111  }
112  }
113  return mask;
114  };

References maskNames().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ maskNames()

static const std::array<maskName,16> maskName::maskNames ( )
inlinestaticprivate

Definition at line 70 of file inotify_watch.cpp.

70  {
71  static const std::array<maskName,16> maskNamesArray {{{IN_ACCESS, "IN_ACCESS"},
72  {IN_ATTRIB, "IN_ATTRIB"},
73  {IN_CLOSE_WRITE, "IN_CLOSE_WRITE"},
74  {IN_CLOSE_NOWRITE, "IN_CLOSE_NOWRITE"},
75  {IN_CREATE, "IN_CREATE"},
76  {IN_DELETE, "IN_DELETE"},
77  {IN_DELETE_SELF, "IN_DELETE_SELF"},
78  {IN_MODIFY, "IN_MODIFY"},
79  {IN_MOVE_SELF, "IN_MOVE_SELF"},
80  {IN_MOVED_FROM, "IN_MOVED_FROM"},
81  {IN_MOVED_TO, "IN_MOVED_TO"},
82  {IN_OPEN, "IN_OPEN"},
83  {IN_IGNORED, "IN_IGNORED"},
84  {IN_ISDIR, "IN_ISDIR"},
85  {IN_Q_OVERFLOW, "IN_Q_OVERFLOW"},
86  {IN_UNMOUNT, "IN_UNMOUNT"}
87  }};
88  return(maskNamesArray);
89  }

Referenced by addToRange(), maskFromList(), and print().

Here is the caller graph for this function:

◆ print()

static void maskName::print ( std::ostream &  out,
uint32_t  mask 
)
inlinestatic

Definition at line 91 of file inotify_watch.cpp.

91  {
92  bool needComma = false;
93 
94  for (const auto &item : maskNames()) {
95  if (mask & item.bits) {
96  if (needComma) {
97  out << ",";
98  }
99  out << item.name;
100  needComma = true;
101  }
102  }
103  };

References maskNames().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ bits

const uint32_t maskName::bits
private

Definition at line 67 of file inotify_watch.cpp.

◆ name

const std::string maskName::name
private

Definition at line 68 of file inotify_watch.cpp.


The documentation for this class was generated from the following file:
maskName::bits
const uint32_t bits
Definition: inotify_watch.cpp:67
options::internal::typed_base::fAddToRange
virtual void fAddToRange(rangeValueType aValue)
add a value to the range of allowed values
Definition: Options.h:458
maskName::name
const std::string name
Definition: inotify_watch.cpp:68
maskName::maskNames
static const std::array< maskName, 16 > maskNames()
Definition: inotify_watch.cpp:70