Frog
Functions
Frog-util.cxx File Reference
#include "frog/Frog-util.h"
#include <cstring>
#include <set>
#include <string>
#include <ostream>
#include "ticcutils/SocketBasics.h"
#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
Include dependency graph for Frog-util.cxx:

Functions

string prefix (const string &path, const string &fn)
 
set< string > getFileNames (const string &dirName, const string &ext)
 
string check_server (const string &host, const string &port, const string &name)
 

Function Documentation

◆ check_server()

string check_server ( const string &  host,
const string &  port,
const string &  name 
)

check if a certain host:port is available for us

Parameters
hostthe host we check
portthe port we want to access
nameextra information (used in diagnostics only)
Returns
"" on succes or an error message on failure

◆ getFileNames()

set<string> getFileNames ( const string &  dirName,
const string &  ext 
)

extract a (sorted) list of file-names matching an extension pattern

Parameters
dirNamethe search directory
extthe file extension we search
Returns
a sorted list og file-names

◆ prefix()

string prefix ( const string &  path,
const string &  fn 
)

add a full path to the filename fn

Parameters
paththe path to add
fnthe filename to be prefixed
Returns
a new path If fn already contains (relative) path information, it is left unchanged.