MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / has_ctrl_modifier

Function has_ctrl_modifier

subprojects/llama.cpp/common/console.cpp:539–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537 }
538
539 static bool has_ctrl_modifier(const std::string & params) {
540 size_t start = 0;
541 while (start < params.size()) {
542 size_t end = params.find(';', start);
543 size_t len = (end == std::string::npos) ? params.size() - start : end - start;
544 if (len > 0) {
545 int value = 0;
546 for (size_t i = 0; i < len; ++i) {
547 char ch = params[start + i];
548 if (!std::isdigit(static_cast<unsigned char>(ch))) {
549 value = -1;
550 break;
551 }
552 value = value * 10 + (ch - '0');
553 }
554 if (value == 5) {
555 return true;
556 }
557 }
558
559 if (end == std::string::npos) {
560 break;
561 }
562 start = end + 1;
563 }
564 return false;
565 }
566
567 static bool is_space_codepoint(char32_t cp) {
568 return std::iswspace(static_cast<wint_t>(cp)) != 0;

Callers 1

readline_advancedFunction · 0.85

Calls 2

sizeMethod · 0.65
findMethod · 0.65

Tested by

no test coverage detected