it_reader.inline.h 566 B

12345678910111213141516171819
  1. #ifndef AFUN_IT_READER_INLINE_H
  2. #define AFUN_IT_READER_INLINE_H
  3. #include "it_reader.h"
  4. #include "it_exception.h"
  5. namespace aFunit {
  6. StringReader::StringReader(std::string str_, const aFuntool::FilePath &path_)
  7. : Reader{path_, 0}, str{std::move(str_)}, index{0}, len{str.size()} {
  8. }
  9. FileReader::FileReader(const aFuntool::FilePath &path_)
  10. : Reader{path_, 0}, file{aFuntool::fileOpen(path_, "rb")}, no_first{false} {
  11. if (file == nullptr)
  12. throw readerFileOpenError(path_);
  13. }
  14. }
  15. #endif //AFUN_IT_READER_INLINE_H