#include <ascii-file.h>
Public Member Functions | |
AsciiFile () | |
~AsciiFile () | |
void | Close (void) |
bool | Eof (void) const |
bool | Fail (void) const |
void | Open (std::string const &filename, std::ios::openmode mode) |
void | Read (std::string &line) |
Read next line from file. |
Static Public Member Functions | |
static bool | Diff (std::string const &f1, std::string const &f2, uint64_t &lineNumber) |
Compare two ASCII files line-by-line. |
Private Attributes | |
std::fstream | m_file |
std::string | m_filename |
Definition at line 37 of file ascii-file.h.
ns3::AsciiFile::AsciiFile | ( | ) |
Definition at line 35 of file ascii-file.cc.
References m_file, and ns3::FatalImpl::RegisterStream().
ns3::AsciiFile::~AsciiFile | ( | ) |
Definition at line 41 of file ascii-file.cc.
References Close(), m_file, and ns3::FatalImpl::UnregisterStream().
void ns3::AsciiFile::Close | ( | void | ) |
Close the underlying file.
Definition at line 59 of file ascii-file.cc.
References m_file.
Referenced by ~AsciiFile().
|
static |
Compare two ASCII files line-by-line.
f1 | First ASCII file name |
f2 | Second ASCII file name |
lineNumbe | [out] Line number of first different line. |
Definition at line 83 of file ascii-file.cc.
References Eof(), Fail(), Open(), and Read().
bool ns3::AsciiFile::Eof | ( | void | ) | const |
Definition at line 53 of file ascii-file.cc.
References m_file.
Referenced by Diff().
bool ns3::AsciiFile::Fail | ( | void | ) | const |
Definition at line 48 of file ascii-file.cc.
References m_file.
Referenced by Diff().
void ns3::AsciiFile::Open | ( | std::string const & | filename, |
std::ios::openmode | mode | ||
) |
Create a new ascii file or open an existing ascii file.
filename | String containing the name of the file. |
mode | the access mode for the file. |
Definition at line 65 of file ascii-file.cc.
References m_file, and NS_ASSERT.
Referenced by Diff().
void ns3::AsciiFile::Read | ( | std::string & | line | ) |
Read next line from file.
line | [out] line from file |
Definition at line 74 of file ascii-file.cc.
References m_file, and NS_ASSERT.
Referenced by Diff().
|
private |
Definition at line 88 of file ascii-file.h.
Referenced by AsciiFile(), Close(), Eof(), Fail(), Open(), Read(), and ~AsciiFile().
|
private |
Definition at line 87 of file ascii-file.h.