ISIS Logo
UTILITIES
EPICS Utilities
uzhex.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  comp_str = argv[1];
16  }
17  else
18  {
19  std::getline(std::cin, comp_str);
20 // while(iit != eos)
21 // {
22 // comp_str.push_back(*iit);
23 // ++iit;
24 // }
25  }
26  if (comp_str.find_first_of(" \t\r\n") != std::string::npos)
27  {
28  std::cerr << "uzhex: whitespace characters found, did you forget the \"-t\" or \"-S\" options for caget?" << std::endl;
29  return -1;
30  }
31  int ret = uncompressString(comp_str, str);
32  if (ret == 0)
33  {
34  std::cout << str;
35  }
36  return ret;
37 }
int main(int argc, char *argv[])
Definition: jcaput.cpp:36
epicsShareFunc int epicsShareAPI uncompressString(const std::string &comp_str, std::string &str)
uncompress a string created using compressString()
Definition: compress.cpp:41
Copyright © 2013 Science and Technology Facilities Council | Generated by   doxygen 1.8.5