mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Implement majority of Broxygen features delegated to Bro.
Still have to update the Sphinx integration.
This commit is contained in:
parent
bdd359d58c
commit
4f6d01000a
21 changed files with 1494 additions and 342 deletions
43
src/util.cc
43
src/util.cc
|
@ -590,6 +590,33 @@ const char* fmt_access_time(double t)
|
|||
return buf;
|
||||
}
|
||||
|
||||
bool ensure_intermediate_dirs(const char* dirname)
|
||||
{
|
||||
if ( ! dirname || strlen(dirname) == 0 )
|
||||
return false;
|
||||
|
||||
bool absolute = dirname[0] == '/';
|
||||
string path = normalize_path(dirname);
|
||||
|
||||
vector<string> path_components;
|
||||
tokenize_string(path, "/", &path_components);
|
||||
|
||||
string current_dir;
|
||||
|
||||
for ( size_t i = 0; i < path_components.size(); ++i )
|
||||
{
|
||||
if ( i > 0 || absolute )
|
||||
current_dir += "/";
|
||||
|
||||
current_dir += path_components[i];
|
||||
|
||||
if ( ! ensure_dir(current_dir.c_str()) )
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ensure_dir(const char *dirname)
|
||||
{
|
||||
struct stat st;
|
||||
|
@ -976,6 +1003,22 @@ void SafePathOp::DoFunc(PathOpFn fn, const string& path, bool error_aborts)
|
|||
delete [] tmp;
|
||||
}
|
||||
|
||||
string implode_string_vector(const std::vector<std::string>& v,
|
||||
const std::string& delim)
|
||||
{
|
||||
string rval;
|
||||
|
||||
for ( size_t i = 0; i < v.size(); ++i )
|
||||
{
|
||||
if ( i > 0 )
|
||||
rval += delim;
|
||||
|
||||
rval += v[i];
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
string flatten_script_name(const string& name, const string& prefix)
|
||||
{
|
||||
string rval = prefix;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue