MCPcopy Create free account
hub / github.com/MediaArea/MediaInfoLib / CutWithBracketsColon

Function CutWithBracketsColon

Source/MediaInfo/Reader/Reader_libcurl.cpp:91–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }
90 }
91 static void CutWithBracketsColon(std::string& Input, std::string& Output)
92 {
93 size_t BracketCount = 0;
94 const auto Input_Size = Input.size();
95 for (size_t i = 0; i < Input_Size; ++i) {
96 switch (Input[i])
97 {
98 case '[':
99 ++BracketCount;
100 break;
101 case ']':
102 if (!BracketCount)
103 return;
104 --BracketCount;
105 break;
106 case ':':
107 if (!BracketCount) {
108 Output = Input.substr(i + 1);
109 Input.resize(i);
110 return;
111 }
112 break;
113 }
114 }
115 }
116
117 class Url
118 {

Callers 1

UrlMethod · 0.85

Calls 2

sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected