AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
aja Namespace Reference

Functions

bool starts_with (const std::string &str, const std::string &needle)
 
bool starts_with (const std::string &str, const char needle)
 
bool starts_with (const std::wstring &wstr, const std::wstring &needle)
 
bool starts_with (const std::wstring &wstr, const wchar_t needle)
 
bool ends_with (const std::string &str, const std::string &needle)
 
bool ends_with (const std::string &str, const char needle)
 
bool ends_with (const std::wstring &wstr, const std::wstring &needle)
 
bool ends_with (const std::wstring &wstr, const wchar_t needle)
 
std::string & replace (std::string &str, const std::string &from, const std::string &to)
 
int stoi (const std::string &str, std::size_t *idx, int base)
 
long stol (const std::string &str, std::size_t *idx, int base)
 
unsigned long stoul (const std::string &str, std::size_t *idx, int base)
 
unsigned long long stoull (const std::string &str, std::size_t *idx, int base)
 
float stof (const std::string &str, std::size_t *idx)
 
double stod (const std::string &str, std::size_t *idx)
 
long double stold (const std::string &str, std::size_t *idx)
 
std::string to_string (bool val)
 
std::string to_string (int val)
 
std::string to_string (long val)
 
std::string to_string (long long val)
 
std::string to_string (unsigned val)
 
std::string to_string (unsigned long val)
 
std::string to_string (unsigned long long val)
 
std::string to_string (float val)
 
std::string to_string (double val)
 
std::string to_string (long double val)
 
bool string_to_wstring (const std::string &str, std::wstring &wstr)
 
bool wstring_to_string (const std::wstring &wstr, std::string &str)
 
size_t local_min (const size_t &a, const size_t &b)
 
bool string_to_cstring (const std::string &str, char *c_str, size_t c_str_size)
 
void split (const std::string &str, const char delim, std::vector< std::string > &elems)
 
void split (const std::wstring &str, const wchar_t delim, std::vector< std::wstring > &elems)
 
std::vector< std::string > split (const std::string &str, const char delim)
 
std::vector< std::wstring > split (const std::wstring &str, const wchar_t delim)
 
std::vector< std::string > split (const std::string &inStr, const std::string &inDelim)
 
std::vector< std::wstring > split (const std::wstring &inStr, const std::wstring &inDelim)
 
std::string & lower (std::string &str)
 
std::string & upper (std::string &str)
 
std::string & lstrip (std::string &str, const std::string &ws)
 
std::string & rstrip (std::string &str, const std::string &ws)
 
std::string & strip (std::string &str, const std::string &ws)
 
std::string join (const std::vector< std::string > &parts, const std::string &delim)
 
std::string join (const std::set< std::string > &parts, const std::string &delim)
 
char * safer_strncpy (char *target, const char *source, size_t num, size_t maxSize)
 
template<typename T , typename... Args>
std::unique_ptr< T > make_unique (Args &&... args)
 
AJA_EXPORT int reveal_file_in_file_manager (const std::string &filePath)
 

Variables

static std::string WHITESPACE = " \t\n\r"
 

Function Documentation

◆ ends_with() [1/4]

AJA_EXPORT bool aja::ends_with ( const std::string &  str,
const char  needle 
)

Determine if str ends with specified character.

Parameters
[in]strThe string to check
[in]needleThe character to look for at the end of str
Returns
true if str ends with the specified string, otherwise false.

Definition at line 91 of file common.cpp.

◆ ends_with() [2/4]

AJA_EXPORT bool aja::ends_with ( const std::string &  str,
const std::string &  needle 
)

Determine if str ends with specified string.

Parameters
[in]strThe string to check
[in]needleThe substring to look for at the end of str
Returns
true if str ends with the specified string, otherwise false.

Definition at line 83 of file common.cpp.

◆ ends_with() [3/4]

AJA_EXPORT bool aja::ends_with ( const std::wstring &  wstr,
const std::wstring &  needle 
)

Determine if wstr ends with specified string.

Parameters
[in]wstrThe wide string to check
[in]needleThe substring to look for at the end of wstr
Returns
true if wstr ends with the specified string, otherwise false.

Definition at line 96 of file common.cpp.

◆ ends_with() [4/4]

AJA_EXPORT bool aja::ends_with ( const std::wstring &  wstr,
const wchar_t  needle 
)

Determine if wstr ends with specified character.

Parameters
[in]wstrThe wide string to check
[in]needleThe wide character to look for at the end of wstr
Returns
true if wstr ends with the specified string, otherwise false.

Definition at line 104 of file common.cpp.

◆ join() [1/2]

AJA_EXPORT std::string aja::join ( const std::set< std::string > &  parts,
const std::string &  delim = " " 
)

Join a set of strings separated by a string delimiter

Parameters
[in]partsThe set of strings to join together
[in]delimThe string delimiter that will separate the strings
Returns
The joined string made up of the parts concatinated with delimiter string

Definition at line 480 of file common.cpp.

◆ join() [2/2]

AJA_EXPORT std::string aja::join ( const std::vector< std::string > &  parts,
const std::string &  delim = " " 
)

Join a vector of strings separated by a string delimiter

Parameters
[in]partsThe vector of strings to join together
[in]delimThe string delimiter that will separate the strings
Returns
The joined string made up of the parts concatinated with delimiter string

Definition at line 468 of file common.cpp.

◆ local_min()

size_t aja::local_min ( const size_t &  a,
const size_t &  b 
)
inline

Definition at line 322 of file common.cpp.

◆ lower()

AJA_EXPORT std::string & aja::lower ( std::string &  str)

Converts the passed string to lowercase

Parameters
[in,out]strThe string to make lowercase
Returns
Reference to the modified STL string

Definition at line 436 of file common.cpp.

◆ lstrip()

AJA_EXPORT std::string & aja::lstrip ( std::string &  str,
const std::string &  ws = aja::WHITESPACE 
)

Strips the leading whitespace characters from the string

Parameters
[in,out]strThe string to strip leading characters from
[in]wsThe whitespace characters to strip
Returns
Reference to the modified STL string

Definition at line 448 of file common.cpp.

◆ make_unique()

template<typename T , typename... Args>
std::unique_ptr<T> aja::make_unique ( Args &&...  args)

Definition at line 10 of file make_unique_shim.h.

◆ replace()

AJA_EXPORT std::string & aja::replace ( std::string &  str,
const std::string &  from,
const std::string &  to 
)

Replaces all occurrences of a substring within a string with a new string

Parameters
[in,out]strThe string to modify
[in]fromThe substring to look for
[in]toThe string to replace the substring with
Returns
Reference to the modified STL string

Definition at line 110 of file common.cpp.

◆ reveal_file_in_file_manager()

AJA_EXPORT int aja::reveal_file_in_file_manager ( const std::string &  filePath)

◆ rstrip()

AJA_EXPORT std::string & aja::rstrip ( std::string &  str,
const std::string &  ws = aja::WHITESPACE 
)

Strips the trailing whitespace characters from the string

Parameters
[in,out]strThe string to strip trailing characters from
[in]wsThe whitespace characters to strip
Returns
Reference to the modified STL string

Definition at line 454 of file common.cpp.

◆ safer_strncpy()

AJA_EXPORT char * aja::safer_strncpy ( char *  target,
const char *  source,
size_t  num,
size_t  maxSize 
)

Like strncpy() but always adds a null-character at last index of target string

Parameters
[in,out]targetPointer to the destination array where the content is to be copied.
[in]sourceC string to be copied.
[in]numMaximum number of characters to be copied from source.
[in]maxSizeMaximum size of the destination array pointed to by target.
Returns
target is returned

Definition at line 492 of file common.cpp.

◆ split() [1/6]

AJA_EXPORT std::vector< std::string > aja::split ( const std::string &  inStr,
const std::string &  inDelim 
)

Splits a string into substrings at a string delimiter

Parameters
[in]inStrThe string to split into parts
[in]inDelimThe delimiter string to split the string at
Returns
A vector of strings that contains all the substrings

Definition at line 398 of file common.cpp.

◆ split() [2/6]

AJA_EXPORT std::vector< std::string > aja::split ( const std::string &  str,
const char  delim 
)

Splits a string into substrings at a character delimiter

Parameters
[in]strThe string to split into parts
[in]delimThe character delimiter to split the string at
Returns
A vector of strings that contains all the substrings

Definition at line 384 of file common.cpp.

◆ split() [3/6]

AJA_EXPORT void aja::split ( const std::string &  str,
const char  delim,
std::vector< std::string > &  elems 
)

Splits a string into substrings at a character delimiter

Parameters
[in]strThe string to split into parts
[in]delimThe character delimiter to split the string at
[out]elemsA vector of strings that contains all the substrings

Definition at line 350 of file common.cpp.

◆ split() [4/6]

AJA_EXPORT std::vector< std::wstring > aja::split ( const std::wstring &  inStr,
const std::wstring &  inDelim 
)

Splits a wstring into substrings at a string delimiter

Parameters
[in]inStrThe wstring to split into parts
[in]inDelimThe delimiter wstring to split the string at
Returns
A vector of wstrings that contains all the substrings

Definition at line 417 of file common.cpp.

◆ split() [5/6]

AJA_EXPORT std::vector< std::wstring > aja::split ( const std::wstring &  str,
const wchar_t  delim 
)

Splits a wstring into substrings at a character delimiter

Parameters
[in]strThe wstring to split into parts
[in]delimThe wide character delimiter to split the wstring at
Returns
A vector of wstrings that contains all the substrings

Definition at line 391 of file common.cpp.

◆ split() [6/6]

AJA_EXPORT void aja::split ( const std::wstring &  str,
const wchar_t  delim,
std::vector< std::wstring > &  elems 
)

Splits a wstring into substrings at a character delimiter

Parameters
[in]strThe wstring to split into parts
[in]delimThe wide character delimiter to split the wstring at
[out]elemsA vector of wstrings that contains all the substrings

Definition at line 367 of file common.cpp.

◆ starts_with() [1/4]

AJA_EXPORT bool aja::starts_with ( const std::string &  str,
const char  needle 
)

Determine if str starts with specified character.

Parameters
[in]strThe string to check
[in]needleThe character to look for at the start of str
Returns
true if str starts with the specified string, otherwise false.

Definition at line 65 of file common.cpp.

◆ starts_with() [2/4]

AJA_EXPORT bool aja::starts_with ( const std::string &  str,
const std::string &  needle 
)

Determine if str starts with specified string.

Parameters
[in]strThe string to check
[in]needleThe substring to look for at the start of str
Returns
true if str starts with the specified string, otherwise false.

Definition at line 61 of file common.cpp.

◆ starts_with() [3/4]

AJA_EXPORT bool aja::starts_with ( const std::wstring &  wstr,
const std::wstring &  needle 
)

Determine if wstr starts with specified string.

Parameters
[in]wstrThe wide string to check
[in]needleThe substring to look for at the start of wstr
Returns
true if wstr starts with the specified string, otherwise false.

Definition at line 71 of file common.cpp.

◆ starts_with() [4/4]

AJA_EXPORT bool aja::starts_with ( const std::wstring &  wstr,
const wchar_t  needle 
)

Determine if wstr starts with specified character.

Parameters
[in]wstrThe wide string to check
[in]needleThe wide character to look for at the start of wstr
Returns
true if wstr starts with the specified string, otherwise false.

Definition at line 75 of file common.cpp.

◆ stod()

AJA_EXPORT double aja::stod ( const std::string &  str,
std::size_t *  idx = 0 
)

Convert string to double

Parameters
[in]strThe string to get the double value of
[in,out]idxPointer to an object of type size_t, whose value is set by the function to the position of the next character in str after the numerical value. This parameter can also be a null pointer, in which case it is not used.
Returns
The double value of the input str

Definition at line 164 of file common.cpp.

◆ stof()

AJA_EXPORT float aja::stof ( const std::string &  str,
std::size_t *  idx = 0 
)

Convert string to float

Parameters
[in]strThe string to get the float value of
[in,out]idxPointer to an object of type size_t, whose value is set by the function to the position of the next character in str after the numerical value. This parameter can also be a null pointer, in which case it is not used.
Returns
The float value of the input str

Definition at line 159 of file common.cpp.

◆ stoi()

AJA_EXPORT int aja::stoi ( const std::string &  str,
std::size_t *  idx = 0,
int  base = 10 
)

Convert string to integer

Parameters
[in]strThe string to get the int value of
[in,out]idxPointer to an object of type size_t, whose value is set by the function to the position of the next character in str after the numerical value. This parameter can also be a null pointer, in which case it is not used.
[in]baseNumerical base that determines the valid characters and their interpretation. If this is 0, the base is determined by the format (like strtol).
Returns
The int value of the input str

Definition at line 122 of file common.cpp.

◆ stol()

AJA_EXPORT long aja::stol ( const std::string &  str,
std::size_t *  idx = 0,
int  base = 10 
)

Convert string to long

Parameters
[in]strThe string to get the long value of
[in,out]idxPointer to an object of type size_t, whose value is set by the function to the position of the next character in str after the numerical value. This parameter can also be a null pointer, in which case it is not used.
[in]baseNumerical base that determines the valid characters and their interpretation. If this is 0, the base is determined by the format (like strtol).
Returns
The long value of the input str

Definition at line 127 of file common.cpp.

◆ stold()

AJA_EXPORT long double aja::stold ( const std::string &  str,
std::size_t *  idx = 0 
)

Convert string to long double

Parameters
[in]strThe string to get the long double value of
[in,out]idxPointer to an object of type size_t, whose value is set by the function to the position of the next character in str after the numerical value. This parameter can also be a null pointer, in which case it is not used.
Returns
The long double value of the input str

Definition at line 175 of file common.cpp.

◆ stoul()

AJA_EXPORT unsigned long aja::stoul ( const std::string &  str,
std::size_t *  idx = 0,
int  base = 10 
)

Convert string to long long

Parameters
[in]strThe string to get the long long value of
[in,out]idxPointer to an object of type size_t, whose value is set by the function to the position of the next character in str after the numerical value. This parameter can also be a null pointer, in which case it is not used.
[in]baseNumerical base that determines the valid characters and their interpretation. If this is 0, the base is determined by the format (like strtol).
Returns
The long long value of the input str Convert string to unsigned long
Parameters
[in]strThe string to get the unsigned long value of
[in,out]idxPointer to an object of type size_t, whose value is set by the function to the position of the next character in str after the numerical value. This parameter can also be a null pointer, in which case it is not used.
[in]baseNumerical base that determines the valid characters and their interpretation. If this is 0, the base is determined by the format (like strtol).
Returns
The unsigned long value of the input str

Definition at line 143 of file common.cpp.

◆ stoull()

AJA_EXPORT unsigned long long aja::stoull ( const std::string &  str,
std::size_t *  idx = 0,
int  base = 10 
)

Convert string to unsigned long long

Parameters
[in]strThe string to get the unsigned long long value of
[in,out]idxPointer to an object of type size_t, whose value is set by the function to the position of the next character in str after the numerical value. This parameter can also be a null pointer, in which case it is not used.
[in]baseNumerical base that determines the valid characters and their interpretation. If this is 0, the base is determined by the format (like strtol).
Returns
The unsigned long long value of the input str

Definition at line 154 of file common.cpp.

◆ string_to_cstring()

AJA_EXPORT bool aja::string_to_cstring ( const std::string &  str,
char *  c_str,
size_t  c_str_size 
)

Convert string to cstring

Parameters
[in]strThe string to convert
[out]c_strThe char buffer to use as a c string
[in]c_str_sizeThe size of the passed in c_str buffer in bytes
Returns
true if success else false

Definition at line 336 of file common.cpp.

◆ string_to_wstring()

AJA_EXPORT bool aja::string_to_wstring ( const std::string &  str,
std::wstring &  wstr 
)

Convert string to wstring

Parameters
[in]strThe string to convert
[out]wstrThe wstring to convert to
Returns
true if success else false

Definition at line 248 of file common.cpp.

◆ strip()

AJA_EXPORT std::string & aja::strip ( std::string &  str,
const std::string &  ws = aja::WHITESPACE 
)

Strips the leading & trailing whitespace characters from the string

Parameters
[in,out]strThe string to strip leading & trailing characters from
[in]wsThe whitespace characters to strip
Returns
Reference to the modified STL string

Definition at line 461 of file common.cpp.

◆ to_string() [1/10]

AJA_EXPORT std::string aja::to_string ( bool  val)

Convert numerical value to string

Parameters
[in]valThe numerical value to convert
Returns
A string representing the passed value

Definition at line 180 of file common.cpp.

◆ to_string() [2/10]

AJA_EXPORT std::string aja::to_string ( double  val)

Definition at line 230 of file common.cpp.

◆ to_string() [3/10]

AJA_EXPORT std::string aja::to_string ( float  val)

Definition at line 221 of file common.cpp.

◆ to_string() [4/10]

AJA_EXPORT std::string aja::to_string ( int  val)

Definition at line 185 of file common.cpp.

◆ to_string() [5/10]

AJA_EXPORT std::string aja::to_string ( long double  val)

Definition at line 239 of file common.cpp.

◆ to_string() [6/10]

AJA_EXPORT std::string aja::to_string ( long long  val)

Definition at line 197 of file common.cpp.

◆ to_string() [7/10]

AJA_EXPORT std::string aja::to_string ( long  val)

Definition at line 191 of file common.cpp.

◆ to_string() [8/10]

AJA_EXPORT std::string aja::to_string ( unsigned long long  val)

Definition at line 215 of file common.cpp.

◆ to_string() [9/10]

AJA_EXPORT std::string aja::to_string ( unsigned long  val)

Definition at line 209 of file common.cpp.

◆ to_string() [10/10]

AJA_EXPORT std::string aja::to_string ( unsigned  val)

Definition at line 203 of file common.cpp.

◆ upper()

AJA_EXPORT std::string & aja::upper ( std::string &  str)

Converts the passed string to uppercase

Parameters
[in,out]strThe string to make uppercase
Returns
Reference to the modified STL string

Definition at line 442 of file common.cpp.

◆ wstring_to_string()

AJA_EXPORT bool aja::wstring_to_string ( const std::wstring &  wstr,
std::string &  str 
)

Convert wstring to string

Parameters
[in]wstrThe wstring to convert
[out]strThe string to convert to
Returns
true if success else false

Definition at line 285 of file common.cpp.

Variable Documentation

◆ WHITESPACE

std::string aja::WHITESPACE = " \t\n\r"
static

Definition at line 24 of file common.h.