Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. std::ifstream inFile(filePath);
  2. std::vector <std::wstring> store;
  3.  
  4. std::istream_iterator<std::wstring> in_iter(inFile);
  5. std::istream_iterator<std::wstring> eof;
  6.  
  7. //inFile.open(filePath);
  8. const char* str1 = in_iter;
  9. const char* str2 = eof.operator++;
  10. while (in_iter != eof)
  11. {
  12. store.push_back(*in_iter++);
  13. }
  14.  
  15.  
  16. inFile.close();
  17.  
  18. for (auto x : store)
  19. {
  20. int size = store.size();
  21. for (int i = 0; i < size; i++)
  22. {
  23. std::wstring * ptr = &store[i];
  24.  
  25. long length = (*ptr).length();
  26. pgInsert(pg, (const pg_char_ptr)ptr, length, CURRENT_POSITION,
  27. data_insert_mode, 0, best_way);
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement