incron  0.5.10
Public Member Functions | Static Public Member Functions | Protected Attributes
IncronTabEntry Class Reference

Incron table entry class. More...

#include <incrontab.h>

List of all members.

Public Member Functions

 IncronTabEntry ()
 Constructor.
 IncronTabEntry (const std::string &rPath, uint32_t uMask, const std::string &rCmd)
 Constructor.
 ~IncronTabEntry ()
 Destructor.
std::string ToString () const
 Converts the entry to string representation.
const std::string & GetPath () const
 Returns the watch filesystem path.
int32_t GetMask () const
 Returns the event mask.
const std::string & GetCmd () const
 Returns the command string.
bool IsNoLoop () const
 Checks whether this entry has set loop-avoidance.

Static Public Member Functions

static bool Parse (const std::string &rStr, IncronTabEntry &rEntry)
 Parses a string and attempts to extract entry parameters.
static std::string GetSafePath (const std::string &rPath)
 Add backslashes before spaces in the source path.

Protected Attributes

std::string m_path
 watch path
uint32_t m_uMask
 event mask
std::string m_cmd
 command string
bool m_fNoLoop
 no loop yes/no

Detailed Description

Incron table entry class.


Constructor & Destructor Documentation

IncronTabEntry::IncronTabEntry ( )

Constructor.

Creates an empty entry for later use with Parse().

See also:
Parse()
IncronTabEntry::IncronTabEntry ( const std::string &  rPath,
uint32_t  uMask,
const std::string &  rCmd 
)

Constructor.

Creates an entry based on defined parameters.

Parameters:
[in]rPathwatched filesystem path
[in]uMaskevent mask
[in]rCmdcommand string
IncronTabEntry::~IncronTabEntry ( ) [inline]

Destructor.


Member Function Documentation

const std::string& IncronTabEntry::GetCmd ( ) const [inline]

Returns the command string.

Returns:
command string
int32_t IncronTabEntry::GetMask ( ) const [inline]

Returns the event mask.

Returns:
event mask
const std::string& IncronTabEntry::GetPath ( ) const [inline]

Returns the watch filesystem path.

Returns:
watch path
std::string IncronTabEntry::GetSafePath ( const std::string &  rPath) [static]

Add backslashes before spaces in the source path.

It also adds backslashes before all original backslashes of course.

The source string is not modified and a copy is returned instead.

This method is intended to be used for paths in user tables.

Parameters:
[in]rPathpath to be modified
Returns:
modified path
bool IncronTabEntry::IsNoLoop ( ) const [inline]

Checks whether this entry has set loop-avoidance.

Returns:
true = no loop, false = loop allowed
bool IncronTabEntry::Parse ( const std::string &  rStr,
IncronTabEntry rEntry 
) [static]

Parses a string and attempts to extract entry parameters.

Parameters:
[in]rStrparsed string
[out]rEntryparametrized entry
Returns:
true = success, false = failure
std::string IncronTabEntry::ToString ( ) const

Converts the entry to string representation.

This method creates a string for use in a table file.

Returns:
string representation

Member Data Documentation

std::string IncronTabEntry::m_cmd [protected]

command string

bool IncronTabEntry::m_fNoLoop [protected]

no loop yes/no

std::string IncronTabEntry::m_path [protected]

watch path

uint32_t IncronTabEntry::m_uMask [protected]

event mask


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