#include "protobuf_io.h"

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
using google::protobuf::io::FileInputStream;
bool ReadProtoConfig(std::string file,::google::protobuf::Message& param)
{
    int fd=open(file.c_str(),O_RDONLY);
    if(fd==-1) return false;
    FileInputStream* input=new FileInputStream(fd);
    bool succ=google::protobuf::TextFormat::Parse(input,&param);
    delete input;
    close(fd);
    return succ;
}