22 #include <sbuild/environment.h>
23 #include <sbuild/error.h>
24 #include <sbuild/regex.h>
25 #include <sbuild/types.h>
31 #include <sys/types.h>
107 bool lsb_mode =
true);
137 const std::string& separator);
153 template <
typename S>
161 typename S::size_type last_pos =
162 value.find_first_not_of(separator, 0);
164 typename S::size_type pos = value.find_first_of(separator, last_pos);
166 while (pos !=S::npos || last_pos != S::npos)
169 ret.push_back(value.substr(last_pos, pos - last_pos));
171 last_pos = value.find_first_not_of(separator, pos);
172 pos = value.find_first_of(separator, last_pos);
189 std::vector<std::string>
191 const std::string& separator);
207 template <
typename S>
215 typename S::size_type last_pos = 0;
217 typename S::size_type pos = value.find_first_of(separator, last_pos);
219 while (pos !=S::npos || last_pos != S::npos)
222 if (pos == std::string::npos)
224 ret.push_back(value.substr(last_pos, pos));
227 ret.push_back(value.substr(last_pos, pos - last_pos));
230 last_pos = pos + separator.length();
231 pos = value.find_first_of(separator, last_pos);
248 std::vector<std::string>
250 const std::string& separator);
290 const std::string& path,
291 const std::string& prefix);
325 exec (
const std::string& file,
327 const environment& env);
332 template <
typename T>
338 const std::type_info& info =
typeid(T);
342 char *demangled = abi::__cxa_demangle(info.name(), 0, 0, &status);
442 if (!this->
file.empty())
446 std::ostringstream str;
636 (
static_cast<int>(lhs) | static_cast<int>(rhs));
650 (lhs |
static_cast<int>(rhs));
664 (
static_cast<int>(lhs) | rhs);
678 (
static_cast<int>(lhs) & static_cast<int>(rhs));
692 (lhs &
static_cast<int>(rhs));
706 (
static_cast<int>(lhs) & rhs);
741 return (static_cast<stat::mode_bits>(
status.st_mode) & mask) == mask;
768 passwd (
const char *name);
775 passwd (
const std::string& name);
845 group (
const char *name);
852 group (
const std::string& name);