Back to index

nordugrid-arc-nox  1.1.0~rc6
escaped.h
Go to the documentation of this file.
00001 #ifndef __ARC_GM_ESCAPED_H__
00002 #define __ARC_GM_ESCAPED_H__
00003 
00004 #include <string>
00005 
00006 /*
00007   Exchange every occurence of e and '\' in 'str' into \e and '\\'.
00008   todo: move output_escaped_string here.
00009 */
00010 void make_escaped_string(std::string &str,char e = ' ',bool escape_nonprintable = false);
00011 /*
00012   Reads keyword from string at 'buf' separated by 'separator' and
00013   stores it in 'str'. Each couple of characters starting from \ is
00014   replaced by second character. \x## is replaced by code corresponding
00015   to hexadecimal number ##.
00016   Returns number of first character in 'buf', which is not in read keyword.
00017 */
00018 int input_escaped_string(const char* buf,std::string &str,char separator = ' ',char quotes = '"');
00019 /*
00020   Unescape content in same buffer. e is treated as end of string. 
00021 */
00022 char* make_unescaped_string(char* str,char e = 0);
00023 void make_unescaped_string(std::string &str);
00024 
00025 #endif
00026