Cppcheck
Public Member Functions | Public Attributes | Private Attributes | List of all members
ErrorMessage::FileLocation Class Reference

File name and line number. More...

#include <errorlogger.h>

Public Member Functions

 FileLocation (const std::string &file, int line, unsigned int column)
 
 FileLocation (const std::string &file, std::string info, int line, unsigned int column)
 
 FileLocation (const Token *tok, const TokenList *tokenList)
 
 FileLocation (const Token *tok, std::string info, const TokenList *tokenList)
 
std::string getfile (bool convert=true) const
 Return the filename. More...
 
std::string getOrigFile (bool convert=true) const
 Filename with the whole path (no –rp) More...
 
void setfile (std::string file)
 Set the filename. More...
 
std::string stringify () const
 
const std::string & getinfo () const
 

Public Attributes

unsigned int fileIndex
 
int line
 
unsigned int column
 

Private Attributes

std::string mOrigFileName
 
std::string mFileName
 
std::string mInfo
 

Detailed Description

File name and line number.

Internally paths are stored with / separator. When getting the filename it is by default converted to native separators.

Definition at line 55 of file errorlogger.h.

Constructor & Destructor Documentation

◆ FileLocation() [1/4]

ErrorMessage::FileLocation::FileLocation ( const std::string &  file,
int  line,
unsigned int  column 
)
inline

Definition at line 57 of file errorlogger.h.

◆ FileLocation() [2/4]

ErrorMessage::FileLocation::FileLocation ( const std::string &  file,
std::string  info,
int  line,
unsigned int  column 
)
inline

Definition at line 60 of file errorlogger.h.

◆ FileLocation() [3/4]

ErrorMessage::FileLocation::FileLocation ( const Token tok,
const TokenList tokenList 
)

Definition at line 710 of file errorlogger.cpp.

◆ FileLocation() [4/4]

ErrorMessage::FileLocation::FileLocation ( const Token tok,
std::string  info,
const TokenList tokenList 
)

Definition at line 714 of file errorlogger.cpp.

Member Function Documentation

◆ getfile()

std::string ErrorMessage::FileLocation::getfile ( bool  convert = true) const

Return the filename.

Parameters
convertIf true convert path to native separators.
Returns
filename.

Definition at line 718 of file errorlogger.cpp.

References Path::toNativeSeparators().

◆ getinfo()

const std::string& ErrorMessage::FileLocation::getinfo ( ) const
inline

Definition at line 95 of file errorlogger.h.

◆ getOrigFile()

std::string ErrorMessage::FileLocation::getOrigFile ( bool  convert = true) const

Filename with the whole path (no –rp)

Parameters
convertIf true convert path to native separators.
Returns
filename.

Definition at line 725 of file errorlogger.cpp.

References Path::toNativeSeparators().

◆ setfile()

void ErrorMessage::FileLocation::setfile ( std::string  file)

Set the filename.

Parameters
fileFilename to set.

Definition at line 732 of file errorlogger.cpp.

References Path::fromNativeSeparators(), and Path::simplifyPath().

Referenced by ErrorMessage::deserialize().

◆ stringify()

std::string ErrorMessage::FileLocation::stringify ( ) const
Returns
the location as a string. Format: [file:line]

Definition at line 738 of file errorlogger.cpp.

References SuppressionList::Suppression::NO_LINE, and Path::toNativeSeparators().

Member Data Documentation

◆ column

unsigned int ErrorMessage::FileLocation::column

Definition at line 93 of file errorlogger.h.

Referenced by plistLoc().

◆ fileIndex

unsigned int ErrorMessage::FileLocation::fileIndex

Definition at line 91 of file errorlogger.h.

Referenced by plistLoc().

◆ line

int ErrorMessage::FileLocation::line

Definition at line 92 of file errorlogger.h.

Referenced by plistLoc().

◆ mFileName

std::string ErrorMessage::FileLocation::mFileName
private

Definition at line 101 of file errorlogger.h.

◆ mInfo

std::string ErrorMessage::FileLocation::mInfo
private

Definition at line 102 of file errorlogger.h.

◆ mOrigFileName

std::string ErrorMessage::FileLocation::mOrigFileName
private

Definition at line 100 of file errorlogger.h.


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