0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NamespaceFlag.cc
Go to the documentation of this file.
1 /*
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 
26 
27 #include <Common/Compat.h>
28 
29 #include "NamespaceFlag.h"
30 
31 using namespace Hypertable::Lib::Master;
32 using namespace std;
33 
34 string NamespaceFlag::to_str(int flags) {
35  bool pipe_needed {};
36  string str;
37  if (flags & CREATE_INTERMEDIATE) {
38  if (pipe_needed)
39  str += "|";
40  else
41  pipe_needed = true;
42  str += "CREATE_INTERMEDIATE";
43  }
44  if (flags & IF_EXISTS) {
45  if (pipe_needed)
46  str += "|";
47  else
48  pipe_needed = true;
49  str += "IF_EXISTS";
50  }
51  if (flags & IF_NOT_EXISTS) {
52  if (pipe_needed)
53  str += "|";
54  else
55  pipe_needed = true;
56  str += "IF_NOT_EXISTS";
57  }
58  return str;
59 }
static std::string to_str(int flags)
Converts flags to human readable string.
Po::typed_value< String > * str(String *v=0)
Definition: Properties.h:166
STL namespace.
Compatibility Macros for C/C++.
Declarations for NamespaceFlag.