Public Member Functions | Static Public Member Functions | List of all members
FileName Class Reference

Specification of a valid Ensight file-name. More...

Inheritance diagram for FileName:
Inheritance graph
[legend]
Collaboration diagram for FileName:
Collaboration graph
[legend]

Public Member Functions

 FileName (const FileName &)=default
 
 FileName (FileName &&)=default
 
 FileName (const char *s)
 
 FileName (const std::string &s)
 
void stripInvalid ()
 
void operator= (const fileName &)=delete
 
void operator= (const word &)=delete
 
void operator= (const string &)=delete
 
void operator= (const std::string &)=delete
 
void operator= (const char *)=delete
 
- Public Member Functions inherited from fileName
 fileName ()=default
 
 fileName (const fileName &)=default
 
 fileName (fileName &&)=default
 
 fileName (const word &s)
 
 fileName (word &&s)
 
 fileName (const string &s, bool doStrip=true)
 
 fileName (string &&s, bool doStrip=true)
 
 fileName (const std::string &s, bool doStrip=true)
 
 fileName (std::string &&s, bool doStrip=true)
 
 fileName (const char *s, bool doStrip=true)
 
 fileName (const UList< word > &list)
 
 fileName (std::initializer_list< word > list)
 
 fileName (Istream &is)
 
bool assign (const token &tok)
 
void stripInvalid ()
 
bool clean ()
 
Type type (bool followLink=true, bool checkGzip=false) const
 
bool isAbsolute () const
 
fileNametoAbsolute ()
 
bool isBackup () const
 
word name () const
 
word nameLessExt () const
 
word name (const bool noExt) const
 
fileName path () const
 
bool hasPath () const
 
bool removePath ()
 
fileName relative (const fileName &parent, const bool caseTag=false) const
 
fileName lessExt () const
 
word ext () const
 
fileNameext (const word &ending)
 
wordList components (const char delim='/') const
 
word component (const size_type cmpt, const char delim='/') const
 
fileNameoperator= (const fileName &str)
 
fileNameoperator= (fileName &&str)
 
fileNameoperator= (const word &str)
 
fileNameoperator= (word &&str)
 
fileNameoperator= (const string &str)
 
fileNameoperator= (string &&str)
 
fileNameoperator= (const std::string &str)
 
fileNameoperator= (std::string &&str)
 
fileNameoperator= (const char *str)
 
fileNameoperator/= (const string &other)
 
bool hasExt () const
 
bool hasExt (const char *ending) const
 
bool hasExt (const std::string &ending) const
 
bool hasExt (const wordRe &ending) const
 
bool removeExt ()
 
- Public Member Functions inherited from string
 string ()=default
 
 string (const std::string &str)
 
 string (std::string &&str)
 
 string (const char *str)
 
 string (const char *str, const size_type len)
 
 string (const char c)
 
 string (const size_type len, const char c)
 
 string (Istream &is)
 
bool match (const std::string &text) const
 
stringreplace (const std::string &s1, const std::string &s2, size_type pos=0)
 
stringreplaceAll (const std::string &s1, const std::string &s2, size_type pos=0)
 
stringreplaceAny (const std::string &s1, const char c2, size_type pos=0)
 
stringexpand (const bool allowEmpty=false)
 
bool removeRepeated (const char character)
 
bool removeStart (const std::string &text)
 
bool removeStart (const char c)
 
bool removeEnd (const std::string &text)
 
bool removeEnd (const char c)
 
void swap (std::string &str)
 
bool operator() (const std::string &text) const
 
bool starts_with (const std::string &s) const
 
bool starts_with (const char c) const
 
bool ends_with (const std::string &s) const
 
bool ends_with (const char c) const
 
size_type count (const char c) const
 
bool startsWith (const std::string &s) const
 
bool endsWith (const std::string &s) const
 
bool removeTrailing (const char c)
 

Static Public Member Functions

static bool valid (char c)
 
- Static Public Member Functions inherited from fileName
static bool valid (char c)
 
static fileName validate (const std::string &, const bool doClean=true)
 
static fileName concat (const std::string &s1, const std::string &s2, const char delim='/')
 
static bool equals (const std::string &s1, const std::string &s2)
 
static bool clean (std::string &str)
 
static bool isAbsolute (const std::string &str)
 
static bool isBackup (const std::string &str)
 
static std::string name (const std::string &str)
 
static std::string nameLessExt (const std::string &str)
 
static std::string path (const std::string &str)
 
- Static Public Member Functions inherited from string
template<class StringType >
static bool valid (const std::string &str)
 
template<class StringType >
static bool stripInvalid (std::string &str)
 
template<class StringType >
static StringType validate (const std::string &str)
 

Additional Inherited Members

- Public Types inherited from fileName
enum  Type { UNDEFINED = 0, FILE = 1, DIRECTORY = 2, LINK = 4 }
 
- Static Public Attributes inherited from fileName
static const char *const typeName = "fileName"
 
static int debug
 
static int allowSpaceInFileName
 
static const fileName null
 
- Static Public Attributes inherited from string
static const char *const typeName = "string"
 
static int debug
 
static const string null
 
- Protected Member Functions inherited from string
std::string::size_type find_ext () const
 
word ext () const
 
bool ext (const word &ending)
 
bool hasPath () const
 
bool hasExt () const
 
bool hasExt (const char *ending) const
 
bool hasExt (const std::string &ending) const
 
bool hasExt (const wordRe &ending) const
 
bool removeExt ()
 
bool removePath ()
 
- Static Protected Member Functions inherited from string
static std::string::size_type find_ext (const std::string &str)
 
template<class PrimitiveType >
static std::string::size_type string_printf (std::string &output, const char *fmt, const PrimitiveType &val)
 
template<class PrimitiveType >
static std::string::size_type string_printf (std::string &output, const std::string &fmt, const PrimitiveType &val)
 

Detailed Description

Specification of a valid Ensight file-name.

Spaces must be quoted, no '*' wildcards, no '' (structured block continuation).

Overall line length within case file is limited to 1024, but this is not yet addressed.

Note
To assist windows usage, a colon (':') in the name is replaced with by an underscore.

Definition at line 54 of file ensightFileName.H.

Constructor & Destructor Documentation

◆ FileName() [1/4]

FileName ( const FileName )
default

◆ FileName() [2/4]

FileName ( FileName &&  )
default

◆ FileName() [3/4]

FileName ( const char *  s)
inlineexplicit

Definition at line 26 of file ensightFileNameI.H.

References FileName::stripInvalid().

Here is the call graph for this function:

◆ FileName() [4/4]

FileName ( const std::string &  s)
inlineexplicit

Definition at line 34 of file ensightFileNameI.H.

References FileName::stripInvalid().

Here is the call graph for this function:

Member Function Documentation

◆ valid()

bool valid ( char  c)
inlinestatic

Definition at line 44 of file ensightFileNameI.H.

References Foam::constant::universal::c, and fileName::valid().

Here is the call graph for this function:

◆ stripInvalid()

void stripInvalid ( )
inline

Definition at line 55 of file ensightFileNameI.H.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and string::replaceAny().

Referenced by FileName::FileName().

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

◆ operator=() [1/5]

void operator= ( const fileName )
delete

◆ operator=() [2/5]

void operator= ( const word )
delete

◆ operator=() [3/5]

void operator= ( const string )
delete

◆ operator=() [4/5]

void operator= ( const std::string &  )
delete

◆ operator=() [5/5]

void operator= ( const char *  )
delete

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