fhq-server  v0.2.33
Documentation for fhq-server. FreeHackQuest is an open source platform for competitions of computer security.
Static Public Member Functions | List of all members
WsjcppCore Class Reference

#include <wsjcpp_core.h>

Static Public Member Functions

static bool init (int argc, char **argv, const std::string &sApplicationName, const std::string &sApplicationVersion, const std::string &sApplicationAuthor, const std::string &sLibraryNameForExports)
 
static std::string doNormalizePath (const std::string &sPath)
 
static std::string extractFilename (const std::string &sPath)
 
static std::string getCurrentDirectory ()
 
static long getCurrentTimeInMilliseconds ()
 
static long getCurrentTimeInSeconds ()
 
static std::string getCurrentTimeForFilename ()
 
static std::string getCurrentTimeForLogFormat ()
 
static std::string getThreadId ()
 
static std::string formatTimeForWeb (long nTimeInSec)
 
static std::string formatTimeForFilename (long nTimeInSec)
 
static std::string formatTimeUTC (int nTimeInSec)
 
static bool dirExists (const std::string &sFilename)
 
static bool fileExists (const std::string &sFilename)
 
static std::vector< std::string > listOfDirs (const std::string &sDirname)
 
static std::vector< std::string > getListOfDirs (const std::string &sDirname)
 
static std::vector< std::string > listOfFiles (const std::string &sDirname)
 
static std::vector< std::string > getListOfFiles (const std::string &sDirname)
 
static bool makeDir (const std::string &sDirname)
 
static bool writeFile (const std::string &sFilename, const std::string &sContent)
 
static bool readTextFile (const std::string &sFilename, std::string &sOutputContent)
 
static bool readFileToBuffer (const std::string &sFilename, char *pBuffer[], int &nBufferSize)
 
static bool writeFile (const std::string &sFilename, const char *pBuffer, const int nBufferSize)
 
static bool removeFile (const std::string &sFilename)
 
static bool copyFile (const std::string &sSourceFilename, const std::string &sTargetFilename)
 
static bool createEmptyFile (const std::string &sFilename)
 
static std::string & ltrim (std::string &str, const std::string &chars="\\\")
 
static std::string & rtrim (std::string &str, const std::string &chars="\\\")
 
static std::string & trim (std::string &str, const std::string &chars="\\\")
 
static std::string toLower (const std::string &str)
 
static std::string toUpper (const std::string &str)
 
static void replaceAll (std::string &str, const std::string &from, const std::string &to)
 
static std::vector< std::string > split (const std::string &sWhat, const std::string &sDelim)
 
static std::string join (const std::vector< std::string > &vWhat, const std::string &sDelim)
 
static void initRandom ()
 
static std::string createUuid ()
 
static std::string uint2hexString (unsigned int n)
 
static unsigned long convertVoidToULong (void *p)
 
static std::string getPointerAsHex (void *p)
 
static std::string extractURLProtocol (const std::string &sValue)
 
static bool getEnv (const std::string &sName, std::string &sValue)
 
static std::string encodeUriComponent (const std::string &sValue)
 
static std::string decodeUriComponent (const std::string &sValue)
 
static std::string getHumanSizeBytes (long nBytes)
 
static bool recoursiveCopyFiles (const std::string &sSourceDir, const std::string &sTargetDir)
 
static bool recoursiveRemoveDir (const std::string &sDir)
 
static bool setFilePermissions (const std::string &sFilePath, const WsjcppFilePermissions &filePermissions, std::string &sError)
 
static bool getFilePermissions (const std::string &sFilePath, WsjcppFilePermissions &filePermissions, std::string &sError)
 
static std::string doPadLeft (const std::string &sIn, char cWhat, int nLength)
 
static std::string doPadRight (const std::string &sIn, char cWhat, int nLength)
 

Member Function Documentation

◆ convertVoidToULong()

unsigned long WsjcppCore::convertVoidToULong ( void *  p)
static

◆ copyFile()

bool WsjcppCore::copyFile ( const std::string &  sSourceFilename,
const std::string &  sTargetFilename 
)
static

◆ createEmptyFile()

bool WsjcppCore::createEmptyFile ( const std::string &  sFilename)
static

◆ createUuid()

std::string WsjcppCore::createUuid ( )
static

◆ decodeUriComponent()

std::string WsjcppCore::decodeUriComponent ( const std::string &  sValue)
static

◆ dirExists()

bool WsjcppCore::dirExists ( const std::string &  sFilename)
static

◆ doNormalizePath()

std::string WsjcppCore::doNormalizePath ( const std::string &  sPath)
static

◆ doPadLeft()

std::string WsjcppCore::doPadLeft ( const std::string &  sIn,
char  cWhat,
int  nLength 
)
static

◆ doPadRight()

std::string WsjcppCore::doPadRight ( const std::string &  sIn,
char  cWhat,
int  nLength 
)
static

◆ encodeUriComponent()

std::string WsjcppCore::encodeUriComponent ( const std::string &  sValue)
static

◆ extractFilename()

std::string WsjcppCore::extractFilename ( const std::string &  sPath)
static

◆ extractURLProtocol()

std::string WsjcppCore::extractURLProtocol ( const std::string &  sValue)
static

◆ fileExists()

bool WsjcppCore::fileExists ( const std::string &  sFilename)
static

◆ formatTimeForFilename()

std::string WsjcppCore::formatTimeForFilename ( long  nTimeInSec)
static

◆ formatTimeForWeb()

std::string WsjcppCore::formatTimeForWeb ( long  nTimeInSec)
static

◆ formatTimeUTC()

std::string WsjcppCore::formatTimeUTC ( int  nTimeInSec)
static

◆ getCurrentDirectory()

std::string WsjcppCore::getCurrentDirectory ( )
static

◆ getCurrentTimeForFilename()

std::string WsjcppCore::getCurrentTimeForFilename ( )
static

◆ getCurrentTimeForLogFormat()

std::string WsjcppCore::getCurrentTimeForLogFormat ( )
static

◆ getCurrentTimeInMilliseconds()

long WsjcppCore::getCurrentTimeInMilliseconds ( )
static

◆ getCurrentTimeInSeconds()

long WsjcppCore::getCurrentTimeInSeconds ( )
static

◆ getEnv()

bool WsjcppCore::getEnv ( const std::string &  sName,
std::string &  sValue 
)
static

◆ getFilePermissions()

bool WsjcppCore::getFilePermissions ( const std::string &  sFilePath,
WsjcppFilePermissions filePermissions,
std::string &  sError 
)
static

◆ getHumanSizeBytes()

std::string WsjcppCore::getHumanSizeBytes ( long  nBytes)
static

◆ getListOfDirs()

std::vector< std::string > WsjcppCore::getListOfDirs ( const std::string &  sDirname)
static

◆ getListOfFiles()

std::vector< std::string > WsjcppCore::getListOfFiles ( const std::string &  sDirname)
static

◆ getPointerAsHex()

std::string WsjcppCore::getPointerAsHex ( void *  p)
static

◆ getThreadId()

std::string WsjcppCore::getThreadId ( )
static

◆ init()

bool WsjcppCore::init ( int  argc,
char **  argv,
const std::string &  sApplicationName,
const std::string &  sApplicationVersion,
const std::string &  sApplicationAuthor,
const std::string &  sLibraryNameForExports 
)
static

◆ initRandom()

void WsjcppCore::initRandom ( )
static

◆ join()

std::string WsjcppCore::join ( const std::vector< std::string > &  vWhat,
const std::string &  sDelim 
)
static

◆ listOfDirs()

std::vector< std::string > WsjcppCore::listOfDirs ( const std::string &  sDirname)
static

◆ listOfFiles()

std::vector< std::string > WsjcppCore::listOfFiles ( const std::string &  sDirname)
static

◆ ltrim()

std::string & WsjcppCore::ltrim ( std::string &  str,
const std::string &  chars = "\t\n\v\f\r " 
)
static

◆ makeDir()

bool WsjcppCore::makeDir ( const std::string &  sDirname)
static

◆ readFileToBuffer()

bool WsjcppCore::readFileToBuffer ( const std::string &  sFilename,
char *  pBuffer[],
int &  nBufferSize 
)
static

◆ readTextFile()

bool WsjcppCore::readTextFile ( const std::string &  sFilename,
std::string &  sOutputContent 
)
static

◆ recoursiveCopyFiles()

bool WsjcppCore::recoursiveCopyFiles ( const std::string &  sSourceDir,
const std::string &  sTargetDir 
)
static

◆ recoursiveRemoveDir()

bool WsjcppCore::recoursiveRemoveDir ( const std::string &  sDir)
static

◆ removeFile()

bool WsjcppCore::removeFile ( const std::string &  sFilename)
static

◆ replaceAll()

void WsjcppCore::replaceAll ( std::string &  str,
const std::string &  from,
const std::string &  to 
)
static

◆ rtrim()

std::string & WsjcppCore::rtrim ( std::string &  str,
const std::string &  chars = "\t\n\v\f\r " 
)
static

◆ setFilePermissions()

bool WsjcppCore::setFilePermissions ( const std::string &  sFilePath,
const WsjcppFilePermissions filePermissions,
std::string &  sError 
)
static

◆ split()

std::vector< std::string > WsjcppCore::split ( const std::string &  sWhat,
const std::string &  sDelim 
)
static

◆ toLower()

std::string WsjcppCore::toLower ( const std::string &  str)
static

◆ toUpper()

std::string WsjcppCore::toUpper ( const std::string &  str)
static

◆ trim()

std::string & WsjcppCore::trim ( std::string &  str,
const std::string &  chars = "\t\n\v\f\r " 
)
static

◆ uint2hexString()

std::string WsjcppCore::uint2hexString ( unsigned int  n)
static

◆ writeFile() [1/2]

bool WsjcppCore::writeFile ( const std::string &  sFilename,
const std::string &  sContent 
)
static

◆ writeFile() [2/2]

bool WsjcppCore::writeFile ( const std::string &  sFilename,
const char *  pBuffer,
const int  nBufferSize 
)
static

The documentation for this class was generated from the following files: