MCPcopy Create free account
hub / github.com/Tracktion/choc / demonstrateWildcardMatching

Function demonstrateWildcardMatching

examples/text_processing.cpp:102–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102void demonstrateWildcardMatching()
103{
104 std::cout << "\n=== Wildcard Matching Demo ===\n";
105
106 std::vector<std::string> filenames = {
107 "document.txt", "image.png", "video.mp4", "archive.zip",
108 "source.cpp", "header.h", "readme.md", "test_file.txt"
109 };
110
111 std::vector<std::string> patterns = {
112 "*.txt", "*.png", "test_*", "*.*", "*.{cpp,h}", "doc*"
113 };
114
115 for (const auto& pattern : patterns)
116 {
117 std::cout << "\nPattern '" << pattern << "' matches:\n";
118 choc::text::WildcardPattern matcher (pattern, true);
119
120 for (const auto& filename : filenames)
121 if (matcher.matches (filename))
122 std::cout << " " << filename << "\n";
123 }
124}
125
126void demonstrateTextTable()
127{

Callers 1

mainFunction · 0.85

Calls 1

matchesMethod · 0.80

Tested by

no test coverage detected