Owl Positioning System: a Wi-Fi-based, infrastructure-centred indoor positioning system. http://owlps.pu-pm.univ-fcomte.fr/
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.

textfilewriter.hh 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * This file is part of the Owl Positioning System (OwlPS) project.
  3. * It is subject to the copyright notice and license terms in the
  4. * COPYRIGHT.t2t file found in the top-level directory of this
  5. * distribution and at
  6. * https://code.lm7.fr/mcy/owlps/src/master/COPYRIGHT.t2t
  7. * No part of the OwlPS Project, including this file, may be copied,
  8. * modified, propagated, or distributed except according to the terms
  9. * contained in the COPYRIGHT.t2t file; the COPYRIGHT.t2t file must be
  10. * distributed along with this file, either separately or by replacing
  11. * this notice by the COPYRIGHT.t2t file's contents.
  12. */
  13. #ifndef _OWLPS_POSITIONING_TEXTFILEWRITER_HH_
  14. #define _OWLPS_POSITIONING_TEXTFILEWRITER_HH_
  15. #include <string>
  16. #include <fstream>
  17. /// Writes text to a file
  18. /**
  19. * If the file name is a dash ('-'), the standard output is used.
  20. */
  21. class TextFileWriter
  22. {
  23. private:
  24. /// Name of the output file
  25. std::string file_name ;
  26. /// Stream associated with the file
  27. std::ofstream file ;
  28. /// Original rdbuf of the stream
  29. std::streambuf *file_buf ;
  30. public:
  31. explicit TextFileWriter(const std::string &_file_name);
  32. virtual ~TextFileWriter(void) ;
  33. bool write_text(const std::string &text) ;
  34. } ;
  35. #endif // _OWLPS_POSITIONING_TEXTFILEWRITER_HH_