0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LoadDataEscape.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
22 #ifndef HYPERTABLE_LOADDATAESCAPE_H
23 #define HYPERTABLE_LOADDATAESCAPE_H
24 
25 #include "Common/DynamicBuffer.h"
26 #include "Common/String.h"
27 
28 namespace Hypertable {
29 
31 
32  public:
34  bool escape(const char *in_buf, size_t in_len, const char **out_bufp,
35  size_t *out_lenp);
36  bool escape(const char *in_buf, size_t in_len, std::string &out) {
37  const char *out_buf;
38  size_t out_len;
39  bool rval = escape(in_buf, in_len, &out_buf, &out_len);
40  out.clear();
41  out.append(out_buf, out_len);
42  return rval;
43  }
44  bool unescape(const char *in_buf, size_t in_len, const char **out_bufp,
45  size_t *out_lenp);
46  void set_field_separator(char fs) { m_field_separator=fs; }
47 
48  private:
51 
52  };
53 
54 } // namespace Hypertable
55 
56 #endif // HYPERTABLE_LOADDATAESCAPE_H
void set_field_separator(char fs)
bool escape(const char *in_buf, size_t in_len, const char **out_bufp, size_t *out_lenp)
A dynamic, resizable and reference counted memory buffer.
Definition: DynamicBuffer.h:42
A dynamic, resizable memory buffer.
Hypertable definitions
A String class based on std::string.
bool unescape(const char *in_buf, size_t in_len, const char **out_bufp, size_t *out_lenp)
bool escape(const char *in_buf, size_t in_len, std::string &out)