MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / getLocationName

Method getLocationName

src/database/WizDatabase.cpp:4465–4481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4463}
4464
4465CString WizDatabase::getLocationName(const CString& strLocation)
4466{
4467 //FIXME:容错处理,如果路径的结尾不是 '/',则增加该结尾符号
4468 QString strLoc = strLocation;
4469 if (strLoc.right(1) != "/")
4470 strLoc.append('/');
4471
4472 int index = strLoc.lastIndexOf('/', strLocation.length() - 2);
4473 if (index == -1)
4474 return CString();
4475
4476 CString str = strLoc.right(strLocation.length() - index - 1);
4477
4478 str.trim('/');
4479
4480 return str;
4481}
4482
4483CString WizDatabase::getLocationDisplayName(const CString& strLocation)
4484{

Calls 3

lengthMethod · 0.80
CStringClass · 0.50
trimMethod · 0.45

Tested by

no test coverage detected