Hi all,

I'm trying to read a file using the TextFormat and I'm doing like this:

(line 45) int fd = open(sName.c_str(), O_RDONLY);
(line 46) ZeroCopyInputStream *input = new FileInputStream(fd);

where sName is a string with the name of the file I want to read.

Files:
#include <iostream>
#include <fstream>
#include <fcntl.h>
#include <google/protobuf/text_format.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <string>

#include "Configuration.h"
#include "reader.pb.h"

are included and also

using namespace ProtoReader;
using namespace google::protobuf;
using namespace google::protobuf::io;
using google::protobuf::TextFormat;
using std::cout;
using std::endl;
using std::fstream;
using std::ios;
using std::string;

The compiling error I receive is:
../Configuration.cpp:46: error: expected type-specifier before
‘FileInputStream’
../Configuration.cpp:46: error: can't convert ‘int*’ into
‘google::protobuf::io::ZeroCopyInputStream*’ at initialization
../Configuration.cpp:46: error: expected ‘,’ or ‘;’ before ‘FileInputStream’


Can anybody tell me what I'm doing wrong?

Best regards,
-- 
Como dijo el sabio,
vayas donde vayas,
ahí estarás

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to