ISIS Logo
UTILITIES
EPICS Utilities
zhex.cpp
Go to the documentation of this file.
1 #include <string>
2 #include <iostream>
3 #include <iterator>
4 
5 #include <shareLib.h>
6 #include "utilities.h"
7 
8 int main(int argc, char* argv[])
9 {
10  std::string comp_str, str;
11  std::istreambuf_iterator<char> iit (std::cin.rdbuf());
12  std::istreambuf_iterator<char> eos;
13  if (argc >= 2)
14  {
15  str = argv[1];
16  }
17  else
18  {
19  std::getline(std::cin, str);
20 // while(iit != eos)
21 // {
22 // str.push_back(*iit);
23 // ++iit;
24 // }
25  }
26  int ret = compressString(str, comp_str);
27  if (ret == 0)
28  {
29  std::cout << comp_str;
30  }
31  return ret;
32 }
int main(int argc, char *argv[])
Definition: jcaput.cpp:36
epicsShareFunc int epicsShareAPI compressString(const std::string &str, std::string &comp_str)
compress a string usinf zlib and then convert compressed bytes into an ascii hex sequence suitable fo...
Definition: compress.cpp:19
Copyright © 2013 Science and Technology Facilities Council | Generated by   doxygen 1.8.5