#pragma once 
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>

#define DEVICE_FILE_PATH "/home/orangepi/car/master/Deviceld.txt"

class FileReader{
    private:
        std::string _filePath;
        std::ifstream _fileStream;
        void close();

    public:
    // 构造函数，传入文件路径
    FileReader(const std::string& path) : _filePath(path) {}

     // 打开文件
    bool open();

     // 读取整个文件内容为字符串
    std::string readAll();

    // 析构函数确保文件关闭
    ~FileReader() {
        close();
    }

};