Advertisement
Guest User

Untitled

a guest
May 13th, 2022
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. void Machine::downloadSVG(std::string const& input) {
  2.     std::string url = "https://dreampuf.github.io/GraphvizOnline/#";
  3.     std::string s;
  4.     std::ifstream in;
  5.     in.open(input);
  6.     while (!in.eof()) {
  7.         getline(in, s);
  8.         url += s;
  9.     }
  10.     std::string file = "image.svg";
  11.  
  12.    
  13.     if (S_OK == URLDownloadToFile(NULL, url.c_str(), file.c_str(), 0, NULL))
  14.     {
  15.  
  16.         std::cout << "Saved to" <<file << std::endl;
  17.  
  18.  
  19.  
  20.     }
  21.     else {
  22.         std::cout << "Nothing happened." << std::endl;
  23.     }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement