Import all sources from perforce.
This commit is contained in:
38
src/nvcore/TextReader.h
Normal file
38
src/nvcore/TextReader.h
Normal file
@ -0,0 +1,38 @@
|
||||
// This code is in the public domain -- castanyo@yahoo.es
|
||||
|
||||
#ifndef NVCORE_TEXTREADER_H
|
||||
#define NVCORE_TEXTREADER_H
|
||||
|
||||
#include <nvcore/nvcore.h>
|
||||
#include <nvcore/Stream.h>
|
||||
#include <nvcore/Containers.h>
|
||||
|
||||
namespace nv
|
||||
{
|
||||
|
||||
/// Text reader.
|
||||
class NVCORE_CLASS TextReader {
|
||||
public:
|
||||
|
||||
/// Ctor.
|
||||
TextReader(Stream * stream) : m_stream(stream), m_text(512) {
|
||||
nvCheck(stream != NULL);
|
||||
nvCheck(stream->isLoading());
|
||||
}
|
||||
|
||||
char peek();
|
||||
char read();
|
||||
|
||||
const char *readToEnd();
|
||||
|
||||
// Returns a temporary string.
|
||||
const char * readLine();
|
||||
|
||||
private:
|
||||
Stream * m_stream;
|
||||
Array<char> m_text;
|
||||
};
|
||||
|
||||
} // nv namespace
|
||||
|
||||
#endif // NVCORE_TEXTREADER_H
|
Reference in New Issue
Block a user