 |
CUGL 1.3
Cornell University Game Library
|
49 #ifndef __CU_TEXT_READER_H__
50 #define __CU_TEXT_READER_H__
51 #include <cugl/base/CUBase.h>
54 #include "CUPathname.h"
59 #pragma mark TextReader
96 #pragma mark Internal Methods
106 #pragma mark Constructors
139 bool init(
const std::string& file) {
192 bool init(
const std::string& file,
unsigned int capacity) {
209 bool init(
const char* file,
unsigned int capacity) {
294 #pragma mark Static Constructors
310 static std::shared_ptr<TextReader>
alloc(
const std::string& file) {
311 std::shared_ptr<TextReader> result = std::make_shared<TextReader>();
312 return (result->init(file) ? result :
nullptr);
330 static std::shared_ptr<TextReader>
alloc(
const char* file) {
331 std::shared_ptr<TextReader> result = std::make_shared<TextReader>();
332 return (result->init(file) ? result :
nullptr);
351 std::shared_ptr<TextReader> result = std::make_shared<TextReader>();
352 return (result->init(file) ? result :
nullptr);
368 static std::shared_ptr<TextReader>
alloc(
const std::string& file,
unsigned int capacity) {
369 std::shared_ptr<TextReader> result = std::make_shared<TextReader>();
370 return (result->init(file,capacity) ? result :
nullptr);
386 static std::shared_ptr<TextReader>
alloc(
const char* file,
unsigned int capacity) {
387 std::shared_ptr<TextReader> result = std::make_shared<TextReader>();
388 return (result->init(file,capacity) ? result :
nullptr);
404 static std::shared_ptr<TextReader>
alloc(
const Pathname& file,
unsigned int capacity) {
405 std::shared_ptr<TextReader> result = std::make_shared<TextReader>();
406 return (result->init(file,capacity) ? result :
nullptr);
424 std::shared_ptr<TextReader> result = std::make_shared<TextReader>();
425 return (result->initWithAsset(file) ? result :
nullptr);
443 std::shared_ptr<TextReader> result = std::make_shared<TextReader>();
444 return (result->initWithAsset(file) ? result :
nullptr);
460 static std::shared_ptr<TextReader>
allocWithAsset(
const std::string& file,
unsigned int capacity) {
461 std::shared_ptr<TextReader> result = std::make_shared<TextReader>();
462 return (result->initWithAsset(file,capacity) ? result :
nullptr);
478 static std::shared_ptr<TextReader>
allocWithAsset(
const char* file,
unsigned int capacity) {
479 std::shared_ptr<TextReader> result = std::make_shared<TextReader>();
480 return (result->initWithAsset(file,capacity) ? result :
nullptr);
485 #pragma mark Stream Management
513 #pragma mark Read Methods
538 std::string&
read(std::string& data);
563 std::string&
readUTF8(std::string& data);
593 std::string&
readLine(std::string& data);
617 std::string&
readAll(std::string& data);
Sint64 _scursor
Definition: CUTextReader.h:84
static std::shared_ptr< TextReader > alloc(const char *file)
Definition: CUTextReader.h:330
static std::shared_ptr< TextReader > alloc(const Pathname &file)
Definition: CUTextReader.h:350
bool ready() const
Definition: CUTextReader.h:509
Definition: CUPathname.h:85
std::string _sbuffer
Definition: CUTextReader.h:87
Sint64 _ssize
Definition: CUTextReader.h:82
static std::shared_ptr< TextReader > allocWithAsset(const char *file)
Definition: CUTextReader.h:442
bool init(const std::string &file, unsigned int capacity)
Definition: CUTextReader.h:192
std::string _name
Definition: CUTextReader.h:78
static std::shared_ptr< TextReader > alloc(const Pathname &file, unsigned int capacity)
Definition: CUTextReader.h:404
TextReader()
Definition: CUTextReader.h:114
bool initWithAsset(const std::string &file)
Definition: CUTextReader.h:242
bool initWithAsset(const std::string &file, unsigned int capacity)
Definition: CUTextReader.h:274
SDL_RWops * _stream
Definition: CUTextReader.h:80
static std::shared_ptr< TextReader > allocWithAsset(const char *file, unsigned int capacity)
Definition: CUTextReader.h:478
static std::shared_ptr< TextReader > alloc(const char *file, unsigned int capacity)
Definition: CUTextReader.h:386
static std::shared_ptr< TextReader > allocWithAsset(const std::string &file, unsigned int capacity)
Definition: CUTextReader.h:460
bool init(const char *file, unsigned int capacity)
Definition: CUTextReader.h:209
bool init(const std::string &file)
Definition: CUTextReader.h:139
Sint32 _bufoff
Definition: CUTextReader.h:93
static std::shared_ptr< TextReader > alloc(const std::string &file, unsigned int capacity)
Definition: CUTextReader.h:368
bool init(const char *file)
Definition: CUTextReader.h:158
static std::shared_ptr< TextReader > alloc(const std::string &file)
Definition: CUTextReader.h:310
Definition: CUTextReader.h:75
Uint32 _capacity
Definition: CUTextReader.h:91
char * _cbuffer
Definition: CUTextReader.h:89
static std::shared_ptr< TextReader > allocWithAsset(const std::string &file)
Definition: CUTextReader.h:423
~TextReader()
Definition: CUTextReader.h:122