struct tm *newtime;
char tmpbuf[128];
time_t lt1;
time(<1);
newtime = localtime(<1);
strftime(tmpbuf, 128, "%Y%m%d", newtime);
std::string path1 = tmpbuf;
namespace fs = boost::filesystem;
fs::directory_iterator end_iter;
std::string path2 = WebApp::instance().conf().get("root.webserver.stockurl", "");
app.logger().log("dir url : [%s] ", path2);
bool hashist = true;
std::string path = util::path_append(path2, path1);
app.logger().log("file url :[%s] ", path);
fPortfolioName = path;
bool direxst = false;
direxst = boost::filesystem::exists(path2);
if (path2 == "")
{
hashist = false;
app.logger().log("config is null!!!");
app.logger().log("please add your config!!!");
}
if (direxst == false)
{
hashist = false;
}
else if (hashist == true)
{
for (fs::directory_iterator iter(path2); iter != end_iter; ++iter)
{
if (fs::is_regular_file(iter->status()))
{
date_["Date"][iter->path().filename().string()]["name"] = iter->path().filename().string();
app.logger().log("per file url :[%s] ", iter->path().filename().string());
}
}
}
char tmpbuf[128];
time_t lt1;
time(<1);
newtime = localtime(<1);
strftime(tmpbuf, 128, "%Y%m%d", newtime);
std::string path1 = tmpbuf;
namespace fs = boost::filesystem;
fs::directory_iterator end_iter;
std::string path2 = WebApp::instance().conf().get("root.webserver.stockurl", "");
app.logger().log("dir url : [%s] ", path2);
bool hashist = true;
std::string path = util::path_append(path2, path1);
app.logger().log("file url :[%s] ", path);
fPortfolioName = path;
bool direxst = false;
direxst = boost::filesystem::exists(path2);
if (path2 == "")
{
hashist = false;
app.logger().log("config is null!!!");
app.logger().log("please add your config!!!");
}
if (direxst == false)
{
hashist = false;
}
else if (hashist == true)
{
for (fs::directory_iterator iter(path2); iter != end_iter; ++iter)
{
if (fs::is_regular_file(iter->status()))
{
date_["Date"][iter->path().filename().string()]["name"] = iter->path().filename().string();
app.logger().log("per file url :[%s] ", iter->path().filename().string());
}
}
}