MCPcopy Create free account
hub / github.com/davisking/dlib / is_string

Function is_string

dlib/matlab/mex_wrapper.cpp:4992–5002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4990// ----------------------------------------------------------------------------------------
4991
4992bool is_string(const mxArray* arr, const char* str)
4993{
4994 if (mxIsChar(arr))
4995 {
4996 char ch[20];
4997 DLIB_CASSERT(mxGetString(arr, ch, sizeof(ch))==0, "Unable to retrieve string");
4998 ch[sizeof(ch)-1] = 0;// ensure NULL termination regardless of what MATLAB does.
4999 return strcmp(str,ch)==0;
5000 }
5001 return false;
5002}
5003
5004// ----------------------------------------------------------------------------------------
5005

Callers 1

mexFunctionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected