Skip to content

Commit 5575457

Browse files
committed
Find .h
1 parent 28c47b6 commit 5575457

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

drogon_ctl/create_swagger.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <fstream>
3232

3333
using namespace drogon_ctl;
34-
using drogon::filesystem;
3534

3635
static void forEachControllerHeaderIn(
3736
std::string strPath,
@@ -54,20 +53,24 @@ static void forEachControllerHeaderIn(
5453
return;
5554

5655
std::error_code ec;
57-
filesystem::path fsPath(strPath);
58-
if (!filesystem::exists(strPath, ec))
56+
drogon::filesystem::path fsPath(strPath);
57+
if (!drogon::filesystem::exists(strPath, ec))
5958
{
6059
return;
6160
}
62-
for (auto &itr : filesystem::directory_iterator(fsPath))
61+
for (auto &itr : drogon::filesystem::directory_iterator(fsPath))
6362
{
64-
if (filesystem::is_directory(itr.status()))
63+
if (drogon::filesystem::is_directory(itr.status()))
6564
{
6665
forEachControllerHeaderIn(itr.path().string(), cb);
6766
}
6867
else
6968
{
70-
cb(itr.path().string());
69+
auto fileName = itr.path().string();
70+
if (fileName.find(".h") == fileName.length() - 2)
71+
{
72+
cb(fileName);
73+
}
7174
}
7275
}
7376
return;

0 commit comments

Comments
 (0)