MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / IsRoot

Method IsRoot

src/core/unixfsservices.cpp:907–922  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Function name : IsRoot Description : A root path is all '/'s Return type : bool Argument : const TSTRING& strPath //////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

905// Argument : const TSTRING& strPath
906///////////////////////////////////////////////////////////////////////////////
907bool cUnixFSServices::IsRoot(const TSTRING& strPath) const
908{
909 // and empty path is NOT the root path
910 if (strPath.empty())
911 return false;
912
913 // check to see if all characters are a slash
914 for (TSTRING::const_iterator iter = strPath.begin(); iter != strPath.end(); iter++)
915 {
916 // if we've found a char that's not '/', then it's not the root path
917 if (*iter != TW_SLASH)
918 return false;
919 }
920
921 return true;
922}
923
924//*************************************************************************
925//*************************************************************************

Callers 1

util_GetNextPathElementFunction · 0.80

Calls 3

emptyMethod · 0.80
beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected