| 197 | } |
| 198 | |
| 199 | static inline FunctionDoc StringClassifyDoc(std::string class_summary, |
| 200 | std::string class_desc, bool non_empty) { |
| 201 | std::string summary, description; |
| 202 | { |
| 203 | std::stringstream ss; |
| 204 | ss << "Classify strings as " << class_summary; |
| 205 | summary = ss.str(); |
| 206 | } |
| 207 | { |
| 208 | std::stringstream ss; |
| 209 | if (non_empty) { |
| 210 | ss |
| 211 | << ("For each string in `strings`, emit true iff the string is non-empty\n" |
| 212 | "and consists only of "); |
| 213 | } else { |
| 214 | ss |
| 215 | << ("For each string in `strings`, emit true iff the string consists only\n" |
| 216 | "of "); |
| 217 | } |
| 218 | ss << class_desc << ". Null strings emit null."; |
| 219 | description = ss.str(); |
| 220 | } |
| 221 | return StringPredicateDoc(std::move(summary), std::move(description)); |
| 222 | } |
| 223 | |
| 224 | template <typename Type, typename Predicate> |
| 225 | struct StringPredicateFunctor { |
no test coverage detected