diff --git a/include/crpropa/Module.h b/include/crpropa/Module.h index e21c6b555..e62f5b14e 100644 --- a/include/crpropa/Module.h +++ b/include/crpropa/Module.h @@ -60,8 +60,11 @@ class AbstractCondition: public Module { void setRejectFlag(std::string key, std::string value); void setAcceptFlag(std::string key, std::string value); - void printRejectFlag(); - void printAcceptFlag(); + // return the reject flag (key & value), delimiter is the "&". + std::string getRejectFlag(); + + // return the accept flag (key & value), delimiter is the "&" + std::string getAcceptFlag(); }; /** diff --git a/src/Module.cpp b/src/Module.cpp index aabbfd694..3af768bf9 100644 --- a/src/Module.cpp +++ b/src/Module.cpp @@ -76,12 +76,14 @@ void AbstractCondition::setAcceptFlag(std::string key, std::string value) { acceptFlagValue = value; } -void AbstractCondition::printRejectFlag() { - std::cout << "rejectKey: " << rejectFlagKey << " with flag: " << rejectFlagValue << "\n"; +std::string AbstractCondition::getRejectFlag() { + std::string out = rejectFlagKey + "&" + rejectFlagValue; + return out; } -void AbstractCondition::printAcceptFlag() { - std::cout << "acceptKey: " << acceptFlagKey << " with flag: " << acceptFlagValue << "\n"; +std::string AbstractCondition::getAcceptFlag() { + std::string out = acceptFlagKey + "&" + acceptFlagValue; + return out; }