reader.inline.h 786 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef AFUN_READER_INLINE_H
  2. #define AFUN_READER_INLINE_H
  3. #include "reader.h"
  4. namespace aFuncore {
  5. Reader::Reader(aFuntool::FilePath path_, aFuntool::FileLine line_)
  6. : buf{aFuntool::safeCalloc<char>(DEFAULT_BUF_SIZE + 1)}, buf_size{DEFAULT_BUF_SIZE}, read{buf}, read_end{false},
  7. read_error{false}, line{line_}, path{std::move(path_)} {
  8. }
  9. size_t Reader::countRead() const {
  10. return read - buf;
  11. }
  12. bool Reader::isEnd() const {
  13. return read_end;
  14. }
  15. bool Reader::isError() const {
  16. return read_error;
  17. }
  18. aFuntool::FileLine Reader::getFileLine() const {
  19. return line;
  20. }
  21. const aFuntool::FilePath &Reader::getFilePath() const {
  22. return path;
  23. }
  24. }
  25. #endif //AFUN_READER_INLINE_H