Skip to content

Commit

Permalink
add 添加字母形态字符串
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaominghe2014 committed Sep 15, 2023
1 parent d286627 commit d19e4fd
Show file tree
Hide file tree
Showing 3 changed files with 339 additions and 113 deletions.
11 changes: 11 additions & 0 deletions include/base/XString.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ namespace XString

bool isCharInString(const char&,const std::string&);

std::vector<std::string> lettersShape(const std::string &letters);

template<class T_out,class T_in>
T_out convert(const T_in& in)
{
Expand Down Expand Up @@ -86,6 +88,15 @@ namespace XString
}
return ss.str();
}

template<typename T>
std::string toStringAddEnter(const std::vector<T>& v){
std::stringstream ss;
for (const auto& elem : v) {
ss << elem << "\n";
}
return ss.str();
}
};
XLIB_END
#endif /* XString_h */
2 changes: 2 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void setLog()
int numThreads = std::thread::hardware_concurrency();

LOG_I("numThreads = %d",numThreads);

}

void testHttp()
Expand Down Expand Up @@ -681,6 +682,7 @@ void testDecodeAndEncode()

int main(int argc, char *argv[])
{
std::cout <<XString::toStringAddEnter(XString::lettersShape("xlib-test"))<< std::endl;
setLog();
testAStar();
testMath();
Expand Down
Loading

0 comments on commit d19e4fd

Please sign in to comment.