OpenRTM-aist  1.2.1
Classes | Typedefs | Functions
coil Namespace Reference

Common Object Interface Layer. More...

Classes

class  AdjustedClock
 Clock object to handle adjusted clock. More...
 
class  Allocator
 Allocator class. More...
 
class  Async
 Async class. More...
 
class  Async_ref_t
 Async_ref_t template class. More...
 
class  Async_t
 Async_t template class. More...
 
class  ClockManager
 A global clock management class. More...
 
class  Condition
 Condition template class. More...
 
class  DynamicLib
 DynamicLib class. More...
 
class  Factory
 Factory template class. More...
 
class  GetOpt
 GetOpt class. More...
 
class  GlobalFactory
 GlobalFactory template class. More...
 
class  Guard
 Guard template class. More...
 
class  IClock
 An interface to set and get time. More...
 
class  log_stream
 log_stream template class More...
 
class  log_streambuf
 log_streambuf template class More...
 
class  LogicalClock
 Clock object to handle logical clock. More...
 
class  Mutex
 Mutex class. More...
 
class  NonCopyable
 Non-copyable Mixin. More...
 
class  NonCopyableCRTP
 
class  PeriodicTask
 PeriodicTask class. More...
 
class  PeriodicTaskBase
 PeriodicTaskBase class. More...
 
class  Properties
 Class represents a set of properties. More...
 
class  SharedMemory
 SharedMemory class. More...
 
class  SignalAction
 SignalAction class. More...
 
class  Singleton
 Singleton template class. More...
 
class  SystemClock
 clock object to handle system clock More...
 
class  Task
 Task class. More...
 
class  TaskFunc
 TaskFunc template class. More...
 
class  TaskFuncBase
 TaskFuncBase class. More...
 
class  TimeMeasure
 TimeMeasure class. More...
 
class  Timer
 Timer class. More...
 
class  TimeValue
 TimeValue class. More...
 

Typedefs

typedef std::vector< unsigned int > CpuMask
 
typedef log_streambuf< char > LogStreamBuffer
 
typedef log_stream< char > LogStream
 
typedef ::utsname utsname
 Get System information. More...
 
typedef ::pid_t pid_t
 Get process ID of the caller process. More...
 
typedef void(* SignalHandler) (int)
 
typedef std::vector< std::string > vstring
 
typedef std::map< std::string, std::string > mapstring
 

Functions

bool getProcCpuAffinity (CpuMask &cpu_mask)
 Getting current process CPU affinity cpu_mask Current CPU affinity mask is returned as CPU ID in std::vector<unsigned int>. More...
 
bool setProcCpuAffinity (const CpuMask cpu_mask)
 Setting process CPU affinity cpu_mask CPU affinity mask to be set is given with CPU ID in std::vector<unsigned int> list. More...
 
bool setProcCpuAffinity (std::string cpu_mask)
 Setting process CPU affinity with string cpu_mask CPU affinity mask to be set is given with comma separated CPU ID string. More...
 
bool getThreadCpuAffinity (CpuMask &cpu_mask)
 Getting current process CPU affinity cpu_mask Current CPU affinity mask is returned as CPU ID in std::vector<unsigned int>. More...
 
bool setThreadCpuAffinity (const CpuMask cpu_mask)
 Setting process CPU affinity cpu_mask CPU affinity mask to be set is given with CPU ID in std::vector<unsigned int> list. More...
 
bool setThreadCpuAffinity (std::string mask)
 Setting process CPU affinity with string cpu_mask CPU affinity mask to be set is given with comma separated CPU ID string. More...
 
template<typename Object , typename Func >
Async_t< Object, Func > * AsyncInvoker (Object *obj, Func func, bool auto_delete=false)
 Helper function for async member function summons. More...
 
template<typename Object , typename Func >
Async_ref_t< Object, Func > * AsyncInvoker (Object *obj, Func *func, bool auto_delete=false)
 Helper function for async member function summons. More...
 
unsigned short crc16 (const char *str, size_t len)
 
unsigned long crc32 (const char *str, size_t len)
 CRC-32 calculation function. More...
 
template<class AbstractClass , class ConcreteClass >
AbstractClass * Creator ()
 Creator template. More...
 
template<class AbstractClass , class ConcreteClass >
void Destructor (AbstractClass *&obj)
 Destructor template. More...
 
std::string dirname (char *path)
 Get a directory part than a file pass. More...
 
std::string basename (const char *path)
 Get a file name part than a file pass. More...
 
coil::vstring filelist (const char *path, const char *glob_str="")
 Get file list. More...
 
void findFile (std::string dir, std::string filename, coil::vstring &filelist)
 
void getFileList (std::string dir, std::string ext, coil::vstring &filelist)
 
int uname (utsname *name)
 
pid_t getpid ()
 
pid_t getppid ()
 Get process ID of the parent process. More...
 
char * getenv (const char *name)
 Get environment variable. More...
 
int launch_shell (std::string command)
 Launching a process. More...
 
int daemon (int nochdir, int noclose)
 
int create_process (std::string command, std::vector< std::string > &out)
 Launching a process. More...
 
bool dest_to_endpoint (std::string dest_addr, std::string &endpoint)
 Getting network interface name from destination address. More...
 
bool find_dest_ifname (std::string dest_addr, std::string &dest_if)
 Getting network interface name from destination address. More...
 
bool ifname_to_ipaddr (std::string ifname, std::string &ipaddr)
 Get IP address from a network interface name. More...
 
std::wstring string2wstring (std::string str)
 string to wstring conversion More...
 
std::string wstring2string (std::wstring wstr)
 wstring to string conversion More...
 
void toUpper (std::string &str)
 Uppercase String Transformation. More...
 
void toLower (std::string &str)
 Lowercase String Transformation. More...
 
int getlinePortable (std::istream &istr, std::string &line)
 Read a line from input stream. More...
 
bool isEscaped (const std::string &str, std::string::size_type pos)
 Check whether the character is escaped or not. More...
 
std::string escape (const std::string str)
 Escape string. More...
 
std::string unescape (const std::string str)
 Unescape string. More...
 
void eraseBlank (std::string &str)
 Erase blank characters of string. More...
 
void eraseHeadBlank (std::string &str)
 Erase the head blank characters of string. More...
 
void eraseTailBlank (std::string &str)
 Erase the tail blank characters of string. More...
 
void eraseBothEndsBlank (std::string &str)
 Erase the head blank and the tail blank characters of string. More...
 
std::string normalize (std::string &str)
 Erase the head/tail blank and replace upper case to lower case. More...
 
unsigned int replaceString (std::string &str, const std::string from, const std::string to)
 Replace string. More...
 
vstring split (const std::string &input, const std::string &delimiter, bool ignore_empty=false)
 Split string by delimiter. More...
 
bool toBool (std::string str, std::string yes, std::string no, bool default_value=true)
 Convert given string into bool value. More...
 
bool includes (const vstring &list, std::string value, bool ignore_case=true)
 Include if a string is included in string list. More...
 
bool includes (const std::string &list, std::string value, bool ignore_case=true)
 Include if a string is included in string list. More...
 
bool isAbsolutePath (const std::string &str)
 Investigate whether the given string is absolute path or not. More...
 
bool isURL (const std::string &str)
 Investigate whether the given string is URL or not. More...
 
bool isIPv4 (const std::string &str)
 
bool isIPv6 (const std::string &str)
 
coil::mapstring urlparam2map (const std::string &str)
 Investigate whether the given string is URL or not. More...
 
template<class Printable >
std::string otos (Printable n)
 Convert the given object to std::string. More...
 
template<typename To >
bool stringTo (To &val, const char *str)
 Convert the given std::string to object. More...
 
template<>
bool stringTo< std::string > (std::string &val, const char *str)
 Convert the given string to std::string. More...
 
template<>
bool stringTo< bool > (bool &val, const char *str)
 Eliminate duplication from the given string list. More...
 
template<class T >
std::string ptrToHex (T *n)
 Converting a pointer to hexadecimal string. More...
 
template<class T >
bool hexToPtr (T *&ptr, const std::string str)
 Converting hexadecimal string to a pointer. More...
 
vstring unique_sv (vstring sv)
 Eliminate duplication from the given string list. More...
 
std::string flatten (vstring sv, std::string delimiter=", ")
 Create CSV file from the given string list. More...
 
char ** toArgv (const vstring &args)
 Convert the given string list into the argument list. More...
 
std::string sprintf (char const *__restrict fmt,...)
 Convert it into a format given with an argumen. More...
 
std::string replaceEnv (std::string str)
 
unsigned int sleep (unsigned int seconds)
 Stop a processing at specified second time. More...
 
int sleep (TimeValue interval)
 Stop a processing at specified second time. More...
 
int usleep (useconds_t usec)
 Stop a processing at specified micro second time. More...
 
int gettimeofday (struct timeval *tv, struct timezone *tz)
 Get the time and timezone. More...
 
TimeValue gettimeofday ()
 Get the time. More...
 
int settimeofday (const struct timeval *tv, const struct timezone *tz)
 Set the time and timezone. More...
 

Detailed Description

Common Object Interface Layer.

Typedef Documentation

typedef std::vector<unsigned int> coil::CpuMask
typedef log_stream<char> coil::LogStream
typedef std::map<std::string, std::string> coil::mapstring
typedef ::pid_t coil::pid_t

Get process ID of the caller process.

Return a process ID of the caller process.

Returns
Process ID
typedef void(* coil::SignalHandler) (int)

Get System information.

Return a system information to a structure.

Parameters
nameName of structure
Returns
0: Successful, -1: failed
typedef std::vector<std::string> coil::vstring

Function Documentation

template<typename Object , typename Func >
Async_t<Object, Func>* coil::AsyncInvoker ( Object *  obj,
Func  func,
bool  auto_delete = false 
)
inline

Helper function for async member function summons.

Helper function for async member function summons.

Parameters
objThe target object for the asynchronous function.
funcAsynchronous function.
auto_deleteflag for automatic instance destruction.
Returns
Async_t Instance
template<typename Object , typename Func >
Async_ref_t<Object, Func>* coil::AsyncInvoker ( Object *  obj,
Func *  func,
bool  auto_delete = false 
)
inline

Helper function for async member function summons.

Helper function for async member function summons.

Parameters
objThe target object for the asynchronous function.
funcAsynchronous function.
auto_deleteflag for automatic instance destruction.
Returns
Async_ref_t Instance
std::string coil::basename ( const char *  path)
inline

Get a file name part than a file pass.

Get a directory part than a file pass.

Parameters
pathFile path
Returns
File name
unsigned short coil::crc16 ( const char *  str,
size_t  len 
)
unsigned long coil::crc32 ( const char *  str,
size_t  len 
)

CRC-32 calculation function.

CRC type: RFC2083 Appendix 15 http://www.faqs.org/rfcs/rfc2083.html http://www.efg2.com/Lab/Mathematics/CRC.htm CRC polynomial: 0xedb88320L Initial value: 0xFFFFFFFF Output XOR: 0xFFFFFFFF Input bit inversion: None Output bit inversion: None Bit shift: right

Parameters
strData stream
lenData length
Returns
Result calculation
int coil::create_process ( std::string  command,
std::vector< std::string > &  out 
)

Launching a process.

Parameters
commandfull path string to a command to be executed.
out
Returns
0: successful, -1: failed
template<class AbstractClass , class ConcreteClass >
AbstractClass* coil::Creator ( )

Creator template.

Referenced by Destructor().

int coil::daemon ( int  nochdir,
int  noclose 
)
bool coil::dest_to_endpoint ( std::string  dest_addr,
std::string &  endpoint 
)

Getting network interface name from destination address.

This operation returns IP address of a endpoint to be used to communicate with the given destination address. IP address and FQDN hostname are available for the destination address dest_addr. If a destination address are reachable and an endpoint IP address is available, this operation returns true, and otherwise false.

Parameters
dest_addra destination address or host name
endpointa IP address of the endpoint to be used to communicate with the destination address
Returns
successful: true, failed: false
template<class AbstractClass , class ConcreteClass >
void coil::Destructor ( AbstractClass *&  obj)
std::string coil::dirname ( char *  path)
inline

Get a directory part than a file pass.

Get a directory part than a file pass.

Parameters
pathFile path
Returns
Directory name
void coil::eraseBlank ( std::string &  str)

Erase blank characters of string.

Erase blank characters that exist at the head of the given string. Space ' 'and tab '\t' are supported as the blank character.

Parameters
strThe target blank characters of string for the erase
void coil::eraseBothEndsBlank ( std::string &  str)

Erase the head blank and the tail blank characters of string.

Erase the head blank characters and the blank characters that exist at the tail of the given string. Space ' 'and tab '\t' are supported as the blank character.

Parameters
strThe target tail blank characters of string for the erase
void coil::eraseHeadBlank ( std::string &  str)

Erase the head blank characters of string.

Erase the blank characters that exist at the head of the given string. Space ' 'and tab '\t' are supported as the blank character.

Parameters
strThe target head blank characters of string for the erase
void coil::eraseTailBlank ( std::string &  str)

Erase the tail blank characters of string.

Erase the blank characters that exist at the tail of the given string. Space ' 'and tab '\t' are supported as the blank character.

Parameters
strThe target tail blank characters of string for the erase
std::string coil::escape ( const std::string  str)

Escape string.

The following characters are converted.
HT -> "\t"
LF -> "\n"
CR -> "\r"
FF -> "\f"
Single quote and double quote are not processed.

Parameters
strThe target string for the escape
Returns
Result string of the escape
coil::vstring coil::filelist ( const char *  path,
const char *  glob_str = "" 
)
inline

Get file list.

Get a list matching a file designated than a directory path.

Parameters
pathDirectory path
glob_strFile name
Returns
File list
bool coil::find_dest_ifname ( std::string  dest_addr,
std::string &  dest_if 
)

Getting network interface name from destination address.

This operation returns network interface name to be used to communicate with the given destination address. IP address and FQDN hostname are available for the destination address dest_addr. Returned dest_if means the network interface name. If a destination address are reachable and network interface name is available, this operation returns true, and otherwise false.

Parameters
dest_addra destination address or host name
dest_ifa network interface name to be used to communicate with the destination address
Returns
successful: true, failed: false
void coil::findFile ( std::string  dir,
std::string  filename,
coil::vstring filelist 
)
inline
Parameters
dir
filename
filelist
std::string coil::flatten ( vstring  sv,
std::string  delimiter = ", " 
)

Create CSV file from the given string list.

Create CSV that arranged each element of the character string list given by the argument. If the string list is empty, the null will be returned.

Parameters
svThe target string list for creating CSV
delimiterDelimiter string between connected words (default: ",")
Returns
String of CSV creating result

Referenced by hexToPtr().

char* coil::getenv ( const char *  name)
inline

Get environment variable.

Return a environment variable.

Parameters
nameName of environment variable
Returns
Value of environment variable(NULL: nonexistent)
void coil::getFileList ( std::string  dir,
std::string  ext,
coil::vstring filelist 
)
inline
Parameters
dir
ext
filelist

References split().

int coil::getlinePortable ( std::istream &  istr,
std::string &  line 
)

Read a line from input stream.

This function reads a line from input stream. UNIX, Windows or mixed line feed code is acceptable.

Parameters
istrThe input stream.
lineThe output variable to store string to be read.
Returns
The length of read string except line feed character.
pid_t coil::getpid ( )
inline
pid_t coil::getppid ( )
inline

Get process ID of the parent process.

Return a process ID of the parent process.

Returns
Process ID
bool coil::getProcCpuAffinity ( CpuMask cpu_mask)

Getting current process CPU affinity cpu_mask Current CPU affinity mask is returned as CPU ID in std::vector<unsigned int>.

Returns
True: success, False: fail
bool coil::getThreadCpuAffinity ( CpuMask cpu_mask)

Getting current process CPU affinity cpu_mask Current CPU affinity mask is returned as CPU ID in std::vector<unsigned int>.

Returns
True: success, False: fail
int coil::gettimeofday ( struct timeval *  tv,
struct timezone *  tz 
)
inline

Get the time and timezone.

Get the time and timezone

Parameters
tvStructure of time
tzStructure of timezone
Returns
0: successful, -1: failed

References gettimeofday().

Referenced by gettimeofday(), RTC::Timestamp< DataType >::operator()(), setTimestamp(), and coil::Condition< Mutex >::wait().

TimeValue coil::gettimeofday ( )
inline

Get the time.

Get the time

Returns
TimeValue object

References gettimeofday().

Referenced by gettimeofday().

template<class T >
bool coil::hexToPtr ( T *&  ptr,
const std::string  str 
)

Converting hexadecimal string to a pointer.

This function converts given hexadecimal string to a pointer. Hexadecimal string should have "0x" string in the head of string.

Parameters
ptrPointer
strHexadeciaml string
Returns
True will be returned when conversion successful

References flatten(), replaceEnv(), sprintf(), toArgv(), and unique_sv().

bool coil::ifname_to_ipaddr ( std::string  ifname,
std::string &  ipaddr 
)

Get IP address from a network interface name.

This operation returns IP address which is assigned with the given network interface. If IP address could be obtained from the network interface name, this operation returns true, otherwise false.

Parameters
ifnamea network interface name
ipaddrIP address that is assigned to the network interface
Returns
successful: true, failed: false
bool coil::includes ( const vstring list,
std::string  value,
bool  ignore_case = true 
)

Include if a string is included in string list.

if the second argument is included in the comma separated string list of the first argument, This operation returns "true value".

Parameters
listThe target comma separated string
valueThe searched string
Returns
true: included, false: not included
bool coil::includes ( const std::string &  list,
std::string  value,
bool  ignore_case = true 
)

Include if a string is included in string list.

if the second argument is included in the comma separated string list of the first argument, This operation returns "true value".

Parameters
listThe target comma separated string
valueThe searched string
Returns
true: included, false: not included
bool coil::isAbsolutePath ( const std::string &  str)

Investigate whether the given string is absolute path or not.

Investigate whether the given string is absolute path or not. Investigate it as an absolute path, if the string is as follows:

  • The first character '/' (UNIX)
  • The first 3 characters are alphabet +'/'+'\' (Windows)
  • The first 2 characters are '\\' (Windows network path)
Parameters
strThe target string for the investigation
Returns
Investigation result of absolute path
bool coil::isEscaped ( const std::string &  str,
std::string::size_type  pos 
)

Check whether the character is escaped or not.

Check whether the specified character is escaped or not

Parameters
strThe string that includes the character to be investigated.
posThe position of the character to be investigated.
Returns
True if the specified character is escaped, else False.
bool coil::isIPv4 ( const std::string &  str)
bool coil::isIPv6 ( const std::string &  str)
bool coil::isURL ( const std::string &  str)

Investigate whether the given string is URL or not.

Investigate whether the given string is URL or not. When the string '://' is included in the given character string, make it of URL representation.

Parameters
strThe target string for investigation
Returns
URL investigation result
int coil::launch_shell ( std::string  command)

Launching a process.

This function launches a process. The argument is command file name be launched. The command will be searched according to the environment variable PATH of command search path. 0 will be returned if launching process is successful, and -1 will be returned if it is failed.

Parameters
commandfull path string to a command to be executed.
Returns
0: successful, -1: failed
std::string coil::normalize ( std::string &  str)

Erase the head/tail blank and replace upper case to lower case.

Erase the head blank characters and the blank characters that exist at the tail of the given string. Space ' 'and tab '\t' are supported as the blank character. And all upper case cahracters are converted into lower case.

Parameters
strThe target string for the erase

Referenced by RTC::RingBuffer< DataType >::empty(), and RTC::ConnectorDataListenerT< DataType >::operator()().

template<class Printable >
std::string coil::otos ( Printable  n)

Convert the given object to std::string.

Convert the object specified by the argument to string.

Parameters
nThe target object for conversion
Returns
String conversion result
template<class T >
std::string coil::ptrToHex ( T *  n)

Converting a pointer to hexadecimal string.

This function converts given string to hexadecimal string. "0x" will be added the head of the converted string.

Parameters
ptrA pointer to be converted
Returns
Hexadecimal string
std::string coil::replaceEnv ( std::string  str)
Parameters
str
Returns

Referenced by hexToPtr().

unsigned int coil::replaceString ( std::string &  str,
const std::string  from,
const std::string  to 
)

Replace string.

Replace the given string with the specified characters.

Parameters
strThe target characters of string for replacement processing
fromCharacters of replacement source
toCharacters of replacement destination
bool coil::setProcCpuAffinity ( const CpuMask  cpu_mask)

Setting process CPU affinity cpu_mask CPU affinity mask to be set is given with CPU ID in std::vector<unsigned int> list.

Returns
True: success, False: fail
bool coil::setProcCpuAffinity ( std::string  cpu_mask)

Setting process CPU affinity with string cpu_mask CPU affinity mask to be set is given with comma separated CPU ID string.

Returns
True: success, False: fail
bool coil::setThreadCpuAffinity ( const CpuMask  cpu_mask)

Setting process CPU affinity cpu_mask CPU affinity mask to be set is given with CPU ID in std::vector<unsigned int> list.

Returns
True: success, False: fail
bool coil::setThreadCpuAffinity ( std::string  mask)

Setting process CPU affinity with string cpu_mask CPU affinity mask to be set is given with comma separated CPU ID string.

Returns
True: success, False: fail
int coil::settimeofday ( const struct timeval *  tv,
const struct timezone *  tz 
)
inline

Set the time and timezone.

Set the time and timezone

Parameters
tvStructure of time
tzStructure of timezone
Returns
0: successful, -1: failed
unsigned int coil::sleep ( unsigned int  seconds)
inline

Stop a processing at specified second time.

Stop a processing at specified second time.

Parameters
secondsSecond time
Returns
0: successful, >0: failed

References sleep().

Referenced by RTC::Manager::Terminator::svc().

int coil::sleep ( TimeValue  interval)
inline

Stop a processing at specified second time.

Stop a processing at specified second time.

Parameters
intervalTimeValue object
Returns
0: successful, >0: failed

References coil::TimeValue::sec(), and coil::TimeValue::usec().

Referenced by sleep().

vstring coil::split ( const std::string &  input,
const std::string &  delimiter,
bool  ignore_empty = false 
)

Split string by delimiter.

Split the set string by the given delimiter

Parameters
inputThe target characters of string for split
delimiterSplit string (delimiter)
Returns
Split string result list

Referenced by getFileList(), and RTC::ConnectorDataListenerT< DataType >::operator()().

std::string coil::sprintf ( char const *__restrict  fmt,
  ... 
)

Convert it into a format given with an argumen.

Convert it into a format given with an argument and return it.

Parameters
fmtFormat
Returns
String of conversion result

Referenced by hexToPtr().

std::wstring coil::string2wstring ( std::string  str)

string to wstring conversion

This function convert from a string to a wstring.

Parameters
strThe input std::string type string
Returns
Converted std::wstring type string
template<typename To >
bool coil::stringTo ( To &  val,
const char *  str 
)

Convert the given std::string to object.

Convert string given by the argument to specified object.

Parameters
valThe object of conversion destination
strString of conversion source
Returns
true: successful, false: failed

References stringTo< bool >().

Referenced by RTC::RingBuffer< DataType >::empty(), and RTC_exp::PeriodicExecutionContext::getProperty().

template<>
bool coil::stringTo< bool > ( bool &  val,
const char *  str 
)

Eliminate duplication from the given string list.

Create a list of eliminating duplication from the string list given by the argument.

Parameters
svThe string list for confirmation source
Returns
Eliminating duplication result list

Referenced by stringTo().

template<>
bool coil::stringTo< std::string > ( std::string &  val,
const char *  str 
)

Convert the given string to std::string.

Convert string given by the argument to std::string.

Parameters
valString of conversion destination
strString of conversion source
Returns
true: successful, false: failed
char** coil::toArgv ( const vstring args)

Convert the given string list into the argument list.

Convert the string list into the argument list by adding '\0' to each element at the end of the string list given by the argument

Parameters
argsThe target string list for conversion
Returns
String of argument conversion result

Referenced by hexToPtr().

bool coil::toBool ( std::string  str,
std::string  yes,
std::string  no,
bool  default_value = true 
)

Convert given string into bool value.

Compare the specified string with the true representation string and the false representation string, and return the result as bool value. If it matches neither the true representation string nor the false representation string as a result of the comparison, the given default value will be return.

Parameters
strThe target string for investigation
yesThe true representation string
noThe false representation string
default_valueThe default value (The default value:true)
void coil::toLower ( std::string &  str)

Lowercase String Transformation.

This function transforms a given string to lowercase letters

Parameters
strThe input string
void coil::toUpper ( std::string &  str)

Uppercase String Transformation.

This function transforms a given string to uppercase letters

Parameters
strThe input string
int coil::uname ( utsname name)
inline
std::string coil::unescape ( const std::string  str)

Unescape string.

The following characters are converted.
"\t" -> HT
"\n" -> LF
"\r" -> CR
"\f" -> FF
"\"" -> "
"\'" -> '
Note: This is not complete inversion of the escape processing.

Parameters
strThe target string for the unescape
Returns
Result string of the unescape
vstring coil::unique_sv ( vstring  sv)

Eliminate duplication from the given string list.

Create a list of eliminating duplication from the string list given by the argument.

Parameters
svThe string list for confirmation source
Returns
Eliminating duplication result list

Referenced by hexToPtr().

coil::mapstring coil::urlparam2map ( const std::string &  str)

Investigate whether the given string is URL or not.

Investigate whether the given string is URL or not. When the string '://' is included in the given character string, make it of URL representation.

Parameters
strThe target string for investigation
Returns
URL investigation result
int coil::usleep ( useconds_t  usec)
inline

Stop a processing at specified micro second time.

Stop a processing at specified micro second time.

Parameters
usecMicro second time
Returns
0: successful, -1: failed
std::string coil::wstring2string ( std::wstring  wstr)

wstring to string conversion

This function convert from a wstring to a string.

Parameters
strThe input std::wstring type string
Returns
Converted std::string type string