*Newbie* Starting with C++ POCO

Please post support and help requests here.
Posts: 2
Joined: 29 Aug 2013, 18:48

*Newbie* Starting with C++ POCO

Postby AxDSan » 29 Aug 2013, 18:59

I just found a sample POCO has in its support page, and it's like this:

Code: Select all

#include "Poco/File.h"
#include "Poco/Path.h"
#include <iostream>
using Poco::File;
using Poco::Path;
int main(int argc, char** argv)
   std::string tmpPath(Path::temp());
   tmpPath.pushDirectory("PocoFileSample"); //ERROR GOES HERE
   File tmpDir(tmpPath);
   bool exists = tmpDir.exists();
   bool isFile = tmpDir.isFile();
   bool isDir = tmpDir.isDirectory();
   bool canRead = tmpDir.canRead();
   bool canWrite = tmpDir.canWrite();File tmpFile(Path(tmpPath, std::string("PocoFileSample.dat")));
   if (tmpFile.createFile())
      File tmpFile2(Path(tmpPath, std::string("PocoFileSample2.dat")));
      Poco::Timestamp now;
      canWrite = tmpFile.canWrite();
      canWrite = tmpFile.canWrite();
   }std::vector<std::string> files;
   std::vector<std::string>::iterator it = files.begin();
   for (; it != files.end(); ++it)
      std::cout << *it << std::endl;
   return 0;

But it's giving me an error saying:
Error 1 error C2039: 'pushDirectory' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>' C:\Development\poco-1.4.6p1\Projects\PocoConsoleApplication2\PocoConsoleApplication2\Source.cpp 9 1 PocoConsoleApplication2

in other words saying that std::string does not contains the 'pushDirectory' member but Path has it... How can I fix this error?

Thanks for any help in advance :D

Posts: 2
Joined: 29 Aug 2013, 18:48

Re: *Newbie* Starting with C++ POCO

Postby AxDSan » 30 Aug 2013, 21:44

Nevermind people, I fixed it by my own, I easly fixed this, replacing 'pushDirectory' to append

Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests