本文整理汇总了C++中LocalDateTime::month方法的典型用法代码示例。如果您正苦于以下问题:C++ LocalDateTime::month方法的具体用法?C++ LocalDateTime::month怎么用?C++ LocalDateTime::month使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocalDateTime
的用法示例。
在下文中一共展示了LocalDateTime::month方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setDate
//----------------------------------------------------------------------------//
void AstmField::setDate(const LocalDateTime &val, const int &index, const int &repeatedIndex)
{
char output[18];
#if defined(POCO_OS_FAMILY_WINDOWS)
_snprintf_s(output, 16, "%04d%02d%02d", val.year(), val.month(), val.day());
#else
snprintf(output, 16, "%04d%02d%02d", val.year(), val.month(), val.day());
#endif
checkIndex(index, repeatedIndex, true);
_items[index + repeatedIndex * _componentSize] = output;
}
示例2: main
int main(int argc, char **argv)
{
if (argc < 3)
{
cout << "Uage:" << argv[0] << " [ -f ] <src server > <save file >" << endl;
exit(0);
}
signal(SIGHUP, sigroutine); //* 下面设置三个信号的处理方法
signal(SIGINT, sigroutine);
signal(SIGQUIT, sigroutine);
bool dfps = false;
int postion = 0;
if (argc == 4 && (string(argv[1]) == string("-f")))
{
postion++;
dfps = true;
}
NetH264Reader reader(argv[postion + 1]);
FILE *out;
cout << "connect server " << argv[postion + 1] << endl;
if (reader.open())
{
cout << "connect server " << argv[postion + 1] << " sucess" << endl;
out = fopen(argv[postion + 2], "wb");
if (out)
{
H264NALU *nalu = 0;
char naluHead[] =
{ 0x0, 0x0, 0x0, 0x1 };
int time = LocalDateTime().second();
int fps = 0;
while (run)
{
nalu = reader.readH264();
if (nalu != 0)
{
if (dfps)
{
if (LocalDateTime().second() == time)
{
fps++;
}
else
{
LocalDateTime ld;
cout << ld.year() << "-" << ld.month() << "-" << ld.day() << " " << ld.hour() << ":" << ld.minute() << ":" << ld.second() << " recevie fps:" << fps
<< endl;
fps = 1;
time = LocalDateTime().second();
}
}
fwrite(naluHead, 4, 1, out);
fwrite(nalu->getData(), nalu->getLength(), 1, out);
}
else
{
cout << "disconnet server " << endl;
break;
}
}
fclose(out);
out = NULL;
}
else
{
cout << "open file " << argv[postion + 2] << " error" << endl;
}
}
else
{
cout << "connect server " << argv[postion + 1] << " fail" << endl;
}
}