* Forgot to implement isOpenForRead/Writing in TextStream

* Changed isOpenForReading/Writing to const int Stream
This commit is contained in:
Antidote 2013-01-27 12:28:59 -08:00
parent 6c5e489f71
commit a0e341f5cf
3 changed files with 16 additions and 6 deletions

View File

@ -193,13 +193,13 @@ public:
* *
* \return True if open for reading; False otherwise. * \return True if open for reading; False otherwise.
*/ */
virtual bool isOpenForReading(); virtual bool isOpenForReading() const;
/*! \brief Retuns whether or not the Stream is open for writing /*! \brief Retuns whether or not the Stream is open for writing
* *
* \return True if open for writing; False otherwise. * \return True if open for writing; False otherwise.
*/ */
virtual bool isOpenForWriting(); virtual bool isOpenForWriting() const;
/*! \brief Sets the Endianss of the stream /*! \brief Sets the Endianss of the stream
* *

View File

@ -287,12 +287,12 @@ bool Stream::autoResizing() const
return m_autoResize; return m_autoResize;
} }
bool Stream::isOpenForReading() bool Stream::isOpenForReading() const
{ {
return true; return true;
} }
bool Stream::isOpenForWriting() bool Stream::isOpenForWriting() const
{ {
return true; return true;
} }

View File

@ -146,7 +146,7 @@ std::string TextStream::readLineAt(Uint32 line)
return m_lines[line - 1]; return m_lines[line - 1];
} }
void TextStream::writeLineAt(Uint32 line, const std::string& line) void TextStream::writeLineAt(Uint32 line, const std::string& str)
{ {
if (m_accessmode != WriteOnly || m_accessmode != ReadWrite) if (m_accessmode != WriteOnly || m_accessmode != ReadWrite)
throw InvalidOperationException("Stream not open for reading"); throw InvalidOperationException("Stream not open for reading");
@ -154,7 +154,7 @@ void TextStream::writeLineAt(Uint32 line, const std::string& line)
throw InvalidOperationException("A line cannot be zero indexed"); throw InvalidOperationException("A line cannot be zero indexed");
m_currentLine = line; m_currentLine = line;
writeLine(line); writeLine(str);
} }
std::vector<std::string> TextStream::readAllLines() std::vector<std::string> TextStream::readAllLines()
@ -197,6 +197,16 @@ TextStream::TextMode TextStream::textMode() const
return m_textmode; return m_textmode;
} }
bool TextStream::isOpenForReading() const
{
return ((m_accessmode == ReadOnly || m_accessmode == ReadWrite) && m_accessmode != WriteOnly);
}
bool TextStream::isOpenForReading() const
{
return ((m_accessmode == WriteOnly || m_accessmode == ReadWrite) && m_accessmode != ReadOnly);
}
// PRIVATE FUNCTIONS // PRIVATE FUNCTIONS
void TextStream::loadLines() void TextStream::loadLines()
{ {