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