You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 line
1.6KB

  1. /* Arduino SdFat Library
  2. * Copyright (C) 2012 by William Greiman
  3. *
  4. * This file is part of the Arduino SdFat Library
  5. *
  6. * This Library is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This Library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with the Arduino SdFat Library. If not, see
  18. * <http://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file
  22. * \brief SdFile class
  23. */
  24. #include <SdBaseFile.h>
  25. #ifndef SdFile_h
  26. #define SdFile_h
  27. //------------------------------------------------------------------------------
  28. /**
  29. * \class SdFile
  30. * \brief SdBaseFile with Print.
  31. */
  32. class SdFile : public SdBaseFile, public Print {
  33. public:
  34. SdFile() {}
  35. SdFile(const char* name, uint8_t oflag);
  36. #if DESTRUCTOR_CLOSES_FILE
  37. ~SdFile() {}
  38. #endif // DESTRUCTOR_CLOSES_FILE
  39. /** \return value of writeError */
  40. bool getWriteError() {return SdBaseFile::getWriteError();}
  41. /** Set writeError to zero */
  42. void clearWriteError() {SdBaseFile::clearWriteError();}
  43. size_t write(uint8_t b);
  44. int write(const char* str);
  45. int write(const void* buf, size_t nbyte);
  46. size_t write(const uint8_t *buf, size_t size) {
  47. return SdBaseFile::write(buf, size);}
  48. void write_P(PGM_P str);
  49. void writeln_P(PGM_P str);
  50. };
  51. #endif // SdFile_h