コード例 #1
0
//--------------------------------------------------------------------------------------
//       Class:  QuarterlyIndexFileRetriever::PathNameGenerator
//      Method:  QuarterlyIndexFileRetriever::PathNameGenerator
// Description:  constructor
//--------------------------------------------------------------------------------------
QuarterlyIndexFileRetriever::PathNameGenerator::PathNameGenerator (const bg::date& start_date, const bg::date& end_date)
	: start_date_{start_date}, end_date_{end_date}, active_date_{start_date},
		start_year_{start_date.year()}, end_year_{end_date.year()}, active_year_{start_date.year()},
	    start_month_{start_date.month()}, end_month_{end_date.month()}, active_month_{start_date.month()}
{
	fs::path EDGAR_path{std::to_string(active_year_)};
	EDGAR_path /= "QTR" + std::to_string(active_month_ / 3 + (active_month_ % 3 == 0 ? 0 : 1));
	EDGAR_path /= "form.zip";

	path_ = EDGAR_path.string();

}  // -----  end of method QuarterlyIndexFileRetriever::PathNameGenerator::QuarterlyIndexFileRetriever::PathNameGenerator  (constructor)  -----
コード例 #2
0
QDate toQDate(bg::date date)
{
    if (date.is_not_a_date())
    {
        return QDate();
    }
    else
    {
        return QDate(date.year(), date.month(), date.day());
    }
}