Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef CARTOGRAPHER_IO_FAKE_FILE_WRITER_H_
00018 #define CARTOGRAPHER_IO_FAKE_FILE_WRITER_H_
00019
00020 #include <memory>
00021 #include <string>
00022 #include <vector>
00023
00024 #include "cartographer/io/file_writer.h"
00025
00026 namespace cartographer {
00027 namespace io {
00028
00029
00030 class FakeFileWriter : public FileWriter {
00031 public:
00032 FakeFileWriter(const std::string& filename,
00033 std::shared_ptr<std::vector<char>> content);
00034 ~FakeFileWriter() override = default;
00035
00036 bool WriteHeader(const char* data, size_t len) override;
00037 bool Write(const char* data, size_t len) override;
00038 bool Close() override;
00039 std::string GetFilename() override;
00040
00041 private:
00042 bool is_closed_;
00043 std::shared_ptr<std::vector<char>> content_;
00044 std::string filename_;
00045 };
00046
00047 }
00048 }
00049
00050 #endif // CARTOGRAPHER_IO_FAKE_FILE_WRITER_H_