File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,12 +217,24 @@ static std::vector<std::string> splitString(const std::string &line)
217217 return ret;
218218}
219219
220+ static std::string::size_type getQualTypeSplitPos (const std::string& qualType) {
221+ const auto pos1 = qualType.find_first_of (" [(" );
222+ if (pos1 == std::string::npos)
223+ return pos1;
224+ if (qualType[pos1] == ' [' )
225+ return pos1;
226+ const auto pos2 = qualType.find (" )(" );
227+ return (pos2 == std::string::npos) ? pos1 : std::string::npos;
228+ }
229+
220230static std::string getQualTypeBefore (const std::string& qualType) {
221- return qualType.find_first_of (" [(" ) != std::string::npos ? qualType.substr (0 , qualType.find_first_of (" [(" )) : qualType;
231+ const auto pos = getQualTypeSplitPos (qualType);
232+ return (pos == std::string::npos) ? qualType : qualType.substr (0 , pos);
222233}
223234
224235static std::string getQualTypeAfter (const std::string& qualType) {
225- return qualType.find_first_of (" [(" ) != std::string::npos ? qualType.substr (qualType.find_first_of (" [(" )) : " " ;
236+ const auto pos = getQualTypeSplitPos (qualType);
237+ return (pos == std::string::npos) ? " " : qualType.substr (pos);
226238}
227239
228240namespace clangimport {
You can’t perform that action at this time.
0 commit comments