MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / getTitle

Method getTitle

lib/Xtc/Xtc.cpp:62–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62std::string Xtc::getTitle() const {
63 if (!loaded || !parser) {
64 return "";
65 }
66
67 // Try to get title from XTC metadata first
68 std::string title = parser->getTitle();
69 if (!title.empty()) {
70 return title;
71 }
72
73 // Fallback: extract filename from path as title
74 size_t lastSlash = filepath.find_last_of('/');
75 size_t lastDot = filepath.find_last_of('.');
76
77 if (lastSlash == std::string::npos) {
78 lastSlash = 0;
79 } else {
80 lastSlash++;
81 }
82
83 if (lastDot == std::string::npos || lastDot <= lastSlash) {
84 return filepath.substr(lastSlash);
85 }
86
87 return filepath.substr(lastSlash, lastDot - lastSlash);
88}
89
90std::string Xtc::getAuthor() const {
91 if (!loaded || !parser) {

Callers 10

getDataFromBookMethod · 0.45
renderStatusBarMethod · 0.45
getScreenshotInfoMethod · 0.45
onEnterMethod · 0.45
loopMethod · 0.45
renderStatusBarMethod · 0.45
getScreenshotInfoMethod · 0.45
onEnterMethod · 0.45
getStatusBarInfoMethod · 0.45
getScreenshotInfoMethod · 0.45

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected