当前位置: 首页>>代码示例>>C++>>正文


C++ Transaction::Timestamp方法代码示例

本文整理汇总了C++中Transaction::Timestamp方法的典型用法代码示例。如果您正苦于以下问题:C++ Transaction::Timestamp方法的具体用法?C++ Transaction::Timestamp怎么用?C++ Transaction::Timestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Transaction的用法示例。


在下文中一共展示了Transaction::Timestamp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Name

void
Category::Save(ofstream& file)
{
  
  for (Category::Iterator i = Begin(); i != End(); i++) {
    
    Transaction* t = i->second;

    csv_fwrite(file, Name());
    file << ',';

    csv_fwrite(file, t->Timestamp());
    file << ',';

    csv_fwrite(file, t->Reason());
    file << ',';

    ostringstream amount;
    amount.setf(ios::showpoint);
    amount.setf(ios::fixed);
    amount << setprecision(2) << t->Amount();
    csv_fwrite(file, amount.str());
    file << ',';

    csv_fwrite(file, t->Action());
    file << "\r\n"; // Carriage return + line feed (DOS style newline)
  }
}
开发者ID:drcouzelis,项目名称:divvyup,代码行数:28,代码来源:Budget.cpp

示例2:

void
RemoveCategoryCommand::Undo()
{
  if (_document == NULL) {
    return;
  }
  
  // Add the category and all of its transactions
  // back into the budget
  list<Transaction*>::const_iterator it;
  
  for (it = _transactions.begin(); it != _transactions.end(); it++) {
    Transaction* t = *it;
    _document->AddTransaction(_category, t->Timestamp(), t->Reason(), t->Amount(), t->Action());
  }
}
开发者ID:drcouzelis,项目名称:divvyup,代码行数:16,代码来源:Command.cpp

示例3: Transaction

void
RemoveCategoryCommand::SetDocument(Budget* document)
{
  Command::SetDocument(document);
  
  list<Transaction*>::iterator list_it;
  
  // Delete any old transactions (there probably aren't any)
  for (list_it = _transactions.begin(); list_it != _transactions.end(); list_it++) {
    delete *list_it;
  }
  
  Category* c = _document->Categories()->find(_category)->second;
  
  // Save all of the transactions that are in this category
  for (Category::Iterator i = c->Begin(); i != c->End(); i++) {
    Transaction* t = i->second;
    Transaction* new_t = new Transaction(t->Timestamp(), t->Reason(), t->Amount(), t->Action());
    _transactions.push_back(new_t);
  }
}
开发者ID:drcouzelis,项目名称:divvyup,代码行数:21,代码来源:Command.cpp


注:本文中的Transaction::Timestamp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。