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


C++ DBIndexItem::setExchange方法代码示例

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


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

示例1: parse


//.........这里部分代码省略.........
      case 7:
        fmonth = "N";
        break;
      case 8:
        fmonth = "Q";
        break;
      case 9:
        fmonth = "U";
        break;
      case 10:
        fmonth = "V";
        break;
      case 11:
        fmonth = "X";
        break;
      case 12:
        fmonth = "Z";
        break;
      default:
        break;
    }

    if (fd.setSymbol(symbol))
      continue;

    if (year.length())
    {
      symbol.append(year);

      if (fmonth.length())
        symbol.append(fmonth);
      else
        continue;
    }
    else
      continue;

    s = "Futures/";
    QString s2;
    fd.getExchange(s2);
    s.append(s2 + "/");
    fd.getSymbol(s2);
    s.append(s2);
    QString path;
    createDirectory(s, path);
    if (! path.length())
    {
      QString ss(tr("Unable to create futures directory"));
      printStatusLogMessage(ss);
      return;
    }
	
    s = path + "/" + symbol;
    if (plug.open(s, chartIndex))
    {
      QString ss(tr("Could not open db"));
      printStatusLogMessage(ss);
      return;
    }

    DBIndexItem item;
    chartIndex->getIndexItem(symbol, item);
    item.getSymbol(s);
    if (! s.length())
    {
      if (plug.createNewFutures())
        return;

      chartIndex->getIndexItem(symbol, item);

      s = QString::number(Exchange::NYBOT);
      item.setExchange(s);

      item.setQuotePlugin(pluginName);

      chartIndex->setIndexItem(symbol, item);
    }

    plug.setBar(bar);
		 
    plug.close();

    emit signalWakeup();
  }

  f.close();

  downloadComplete();
  if (cancelFlag)
  {
    cancelFlag = FALSE;
    QString ss(tr("Update cancelled"));
    printStatusLogMessage(ss);
  }
  else
  {
    QString ss(tr("Done"));
    printStatusLogMessage(ss);
  }
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:101,代码来源:NYBOT.cpp

示例2: newStock

void Yahoo::newStock ()
{
  bool ok = FALSE;
  QString symbols = QInputDialog::getText(tr("New Yahoo Symbols"),
                                          tr("Enter symbols to add. Note: separate symbols with a space"),
				          QLineEdit::Normal,
				          QString::null,
				          &ok,
				          this);
  if (! symbols.length())
    return;

  QStringList l = QStringList::split(" ", symbols, FALSE);

  QString s;
  config.getData(Config::DataPath, s);
  s.append("/Stocks");
  QDir dir(s);
  if (! dir.exists(s))
  {
    if (! dir.mkdir(s))
    {
      qDebug("YahooDialog::newStock: Unable to create %s directory", s.latin1());
      return;
    }
  }

  if (! dir.exists(dataPath))
  {
    if (! dir.mkdir(dataPath))
    {
      qDebug("YahooDialog::newStock: Unable to create %s directory", dataPath.latin1());
      return;
    }
  }

  QStringList n;
  int loop;
  for (loop = 0; loop < (int) l.count(); loop++)
  {
    QString exchange;
    QString s = dataPath + "/";
    QFileInfo fi(l[loop]);

    if (fi.extension(FALSE).length())
    {
      exchange = fi.extension(FALSE).upper();
      s.append(fi.extension(FALSE).upper());
    }
    else
      s.append("US");

    if (! dir.exists(s))
      {
      if (! dir.mkdir(s))
      {
        qDebug("YahooDialog::newStock: Unable to create %s directory", s.latin1());
        continue;
      }
    }
    
    s.append("/");
    s.append(l[loop]);
    if (dir.exists(s))
      continue;

    if (plug.open(s, chartIndex))
    {
      qDebug("YahooDialog::newStock: could not open db %s", s.latin1());
      plug.close();
      continue;
    }

    n.append(s);
    plug.createNewStock();

    QFileInfo fi2(s);
    QString fn = fi2.fileName();
    DBIndexItem item;
    chartIndex->getIndexItem(fn, item);
    getExchange(exchange, s);
    item.setExchange(s);
    chartIndex->setIndexItem(fn, item);

    plug.close();
  }

  list->setFile(n);
  allSymbols->setCheckState(Qt::Unchecked);
  method->setCurrentIndex(0);
  methodChanged(0);
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:92,代码来源:Yahoo.cpp


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