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

File name and line number. More...

#include <errorlogger.h>

Public Member Functions

 FileLocation ()
 
 FileLocation (const std::string &file, int line, int column)
 
 FileLocation (const std::string &file, const std::string &info, int line, int column)
 
 FileLocation (const Token *tok, const TokenList *tokenList)
 
 FileLocation (const Token *tok, const 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 (const std::string &file)
 Set the filename. More...
 
std::string stringify () const
 
std::string getinfo () const
 
void setinfo (const std::string &i)
 

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 156 of file errorlogger.h.

Constructor & Destructor Documentation

◆ FileLocation() [1/5]

ErrorLogger::ErrorMessage::FileLocation::FileLocation ( )
inline

Definition at line 158 of file errorlogger.h.

◆ FileLocation() [2/5]

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

Definition at line 162 of file errorlogger.h.

◆ FileLocation() [3/5]

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

Definition at line 166 of file errorlogger.h.

◆ FileLocation() [4/5]

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

Definition at line 645 of file errorlogger.cpp.

◆ FileLocation() [5/5]

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

Definition at line 650 of file errorlogger.cpp.

Member Function Documentation

◆ getfile()

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

Return the filename.

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

Definition at line 655 of file errorlogger.cpp.

References mFileName, and Path::toNativeSeparators().

Referenced by CppCheck::checkFile(), and reportClangErrors().

◆ getinfo()

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

Definition at line 202 of file errorlogger.h.

◆ getOrigFile()

std::string ErrorLogger::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 662 of file errorlogger.cpp.

References mOrigFileName, and Path::toNativeSeparators().

◆ setfile()

void ErrorLogger::ErrorMessage::FileLocation::setfile ( const std::string &  file)

◆ setinfo()

void ErrorLogger::ErrorMessage::FileLocation::setinfo ( const std::string &  i)
inline

◆ stringify()

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

Definition at line 676 of file errorlogger.cpp.

References line, mFileName, Suppressions::Suppression::NO_LINE, and Path::toNativeSeparators().

Referenced by TokenList::fileLine().

Member Data Documentation

◆ column

unsigned int ErrorLogger::ErrorMessage::FileLocation::column

◆ fileIndex

unsigned int ErrorLogger::ErrorMessage::FileLocation::fileIndex

Definition at line 198 of file errorlogger.h.

Referenced by plistLoc().

◆ line

int ErrorLogger::ErrorMessage::FileLocation::line

◆ mFileName

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

Definition at line 211 of file errorlogger.h.

Referenced by getfile(), setfile(), and stringify().

◆ mInfo

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

Definition at line 212 of file errorlogger.h.

◆ mOrigFileName

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

Definition at line 210 of file errorlogger.h.

Referenced by getOrigFile().


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