The Sleuth Kit Framework  4.1
Static Public Member Functions | List of all members
TskUtilities Class Reference

Contains commonly needed utility methods. More...

#include <TskUtilities.h>

Static Public Member Functions

static void cleanUTF8 (char *buf)
 
static bool getHostIP (const std::string &host, std::string &host_ip)
 Get the IP address for the given host name. More...
 
static std::string getProgDir ()
 Get the path of the directory where the currently executing program is installed. More...
 
static std::string stripQuotes (const std::string &str)
 Strip matching leading and trailing double quotes from the input str. More...
 
static std::wstring toUTF16 (const std::string &utf8Str)
 Convert a given UTF8 string to UTF16. More...
 
static std::string toUTF8 (const std::wstring &utf16Str)
 Convert a given UTF16 string to UTF8. More...
 

Detailed Description

Contains commonly needed utility methods.

Refer to the poco library for other commonly needed methods.

Member Function Documentation

bool TskUtilities::getHostIP ( const std::string &  host,
std::string &  host_ip 
)
static

Get the IP address for the given host name.

Parameters
hostThe name of the host who's IP address you want.
host_ipThis string will be filled in with the IP address.
Returns
true on success, false otherwise.

References LOGERROR.

Referenced by TskImgDBPostgreSQL::open().

std::string TskUtilities::getProgDir ( )
static

Get the path of the directory where the currently executing program is installed.

Returns
The path of the program directory.

References toUTF8().

Referenced by TskSystemProperties::get().

std::string TskUtilities::stripQuotes ( const std::string &  str)
static

Strip matching leading and trailing double quotes from the input str.

If there is no matching quotes, the input str is returned.

Returns
String without matching leading and trailing double quote.
std::wstring TskUtilities::toUTF16 ( const std::string &  utf8Str)
static

Convert a given UTF8 string to UTF16.

Parameters
utf8StrThe UTF8 encoded string.
Returns
A UTF16 encoded version of the input string.

References TSKconversionOK, and TSKstrictConversion.

Referenced by TskFileManagerImpl::copyDirectory(), TskSystemProperties::expandMacrosW(), Log::getLogPathW(), TskFileManagerImpl::getPath(), TskSystemProperties::getW(), and TskCarveExtractScalpel::processFile().

std::string TskUtilities::toUTF8 ( const std::wstring &  utf16Str)
static

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

Copyright © 2011-2013 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.