@@ -959,19 +959,49 @@ class CPPCHECKLIB Token {
959959 */
960960 static void eraseTokens (Token *begin, const Token *end);
961961
962+ /* *
963+ * Insert new token after this token. This function will handle
964+ * relations between next and previous token also.
965+ * @param tokenStr String for the new token.
966+ * the first one on the tokens list.
967+ */
968+ RET_NONNULL Token* insertToken (const std::string& tokenStr)
969+ {
970+ return insertToken (tokenStr, false );
971+ }
962972 /* *
963973 * Insert new token after this token. This function will handle
964974 * relations between next and previous token also.
965975 * @param tokenStr String for the new token.
966976 * @param originalNameStr String used for Token::originalName().
967977 * the first one on the tokens list.
968978 */
969- RET_NONNULL Token* insertToken (const std::string& tokenStr, const std::string& originalNameStr = emptyString, const std::string& macroNameStr = emptyString)
979+ RET_NONNULL Token* insertToken (const std::string& tokenStr, const std::string& originalNameStr)
980+ {
981+ return insertToken (tokenStr, originalNameStr, false );
982+ }
983+ /* *
984+ * Insert new token after this token. This function will handle
985+ * relations between next and previous token also.
986+ * @param tokenStr String for the new token.
987+ * @param originalNameStr String used for Token::originalName().
988+ * @param macroNameStr String used for Token::getMacroName().
989+ * the first one on the tokens list.
990+ */
991+ RET_NONNULL Token* insertToken (const std::string& tokenStr, const std::string& originalNameStr, const std::string& macroNameStr)
970992 {
971993 return insertToken (tokenStr, originalNameStr, macroNameStr, false );
972994 }
973995
974- RET_NONNULL Token* insertTokenBefore (const std::string& tokenStr, const std::string& originalNameStr = emptyString, const std::string& macroNameStr = emptyString)
996+ RET_NONNULL Token* insertTokenBefore (const std::string& tokenStr)
997+ {
998+ return insertToken (tokenStr, true );
999+ }
1000+ RET_NONNULL Token* insertTokenBefore (const std::string& tokenStr, const std::string& originalNameStr)
1001+ {
1002+ return insertToken (tokenStr, originalNameStr, true );
1003+ }
1004+ RET_NONNULL Token* insertTokenBefore (const std::string& tokenStr, const std::string& originalNameStr, const std::string& macroNameStr)
9751005 {
9761006 return insertToken (tokenStr, originalNameStr, macroNameStr, true );
9771007 }
@@ -1404,6 +1434,8 @@ class CPPCHECKLIB Token {
14041434 */
14051435 static const char *chrInFirstWord (const char *str, char c);
14061436
1437+ RET_NONNULL Token* insertToken (const std::string& tokenStr, bool prepend);
1438+ RET_NONNULL Token* insertToken (const std::string& tokenStr, const std::string& originalNameStr, bool prepend);
14071439 RET_NONNULL Token* insertToken (const std::string& tokenStr, const std::string& originalNameStr, const std::string& macroNameStr, bool prepend);
14081440
14091441 std::string mStr ;
0 commit comments