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


C++ Count函数代码示例

本文整理汇总了C++中Count函数的典型用法代码示例。如果您正苦于以下问题:C++ Count函数的具体用法?C++ Count怎么用?C++ Count使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: f_date_create

bool TestExtDatetime::test_date_time_set() {
  Object dt = f_date_create("2006-12-12 12:34:56");
  f_date_time_set(dt, 23, 45, 12);
  VDT(dt, "2006-12-12 23:45:12");
  return Count(true);
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:6,代码来源:test_ext_datetime.cpp

示例2: f_get_class_constants

bool TestExtClass::test_get_class_constants() {
  Array constants = f_get_class_constants("test");
  VS(constants, CREATE_MAP1("const_foo", "f"));
  return Count(true);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:5,代码来源:test_ext_class.cpp

示例3: OnTreeSelectionChanged

void MainFrame::OnTreeSelectionChanged(wxTreeEvent &event) {
  auto treeItemId = event.GetItem();
  auto rootId = dirTree->GetRootItem();
  auto currentFileEntry =
      dynamic_cast<EntryItemData *>(dirTree->GetItemData(treeItemId))->Get();

  auto gridPanel = dynamic_cast<wxScrolledWindow *>(splitter->GetWindow2());

  if (loadThread) {
    loadThread->Delete(nullptr, wxTHREAD_WAIT_BLOCK);
    loadThread = nullptr;
  }

  gridPanel->Show(false);
  auto grid = gridPanel->GetSizer();
  grid->Clear(true);

  std::vector<Entry *> loadEntries;
  imgButtons.clear();
  for (int i = 0; i < currentFileEntry->Count(); ++i) {
    Entry *childEntry = (*currentFileEntry)[i];

    if (childEntry->IsDirectory())
      continue;
    auto ext = childEntry->Name().AfterLast('.').Lower();

    if (ext != "jpg" && ext != "jpeg" && ext != "png" && ext != "gif")
      continue;

    loadEntries.push_back(childEntry);
  }

  for (auto entry : loadEntries) {
    auto button = new wxButton(gridPanel, wxID_ANY, "", wxDefaultPosition,
                               wxDefaultSize, wxBU_EXACTFIT);
    imgButtons.push_back(button);
    button->Bind(wxEVT_BUTTON, &MainFrame::OnImageButtonClick, this);

    button->SetClientObject(new EntryItemData(entry));
    button->SetMinSize({250, 250});

    auto staticText = new wxStaticText(gridPanel, wxID_ANY, entry->Name());
    staticText->SetMaxSize({250, 50});

    auto btnSizer = new wxBoxSizer(wxVERTICAL);
    btnSizer->Add(button, 0, wxEXPAND);
    btnSizer->Add(staticText);

    grid->Add(btnSizer, 0, wxALL | wxEXPAND, 5);
  }

  GetStatusBar()->SetStatusText(wxString::Format("Loading Thumbnail %i of %i",
                                                 1, (int)loadEntries.size()));

  grid->FitInside(gridPanel);
  gridPanel->Show(true);
  gridPanel->Scroll(0, 0);

  gridPanel->Refresh();
  gridPanel->Update();

  loadThread = new ThumbnailLoadThread(this, loadEntries, currentEntry);
  loadThread->Run();
  threadId = loadThread->GetId();
}
开发者ID:wutipong,项目名称:ZipPicViewWx,代码行数:65,代码来源:MainFrame.cpp

示例4: VERIFY

bool TestExtClass::test_class_exists() {
  VERIFY(f_class_exists("TEst"));
  return Count(true);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:4,代码来源:test_ext_class.cpp

示例5: f_get_class_methods

bool TestExtClass::test_get_class_methods() {
  Array methods = f_get_class_methods("TEst");
  VS(methods[0], "foo");
  return Count(true);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:5,代码来源:test_ext_class.cpp

示例6: Count

bool TestExtClass::test_get_object_vars() {
  // TestCodeRun covers this
  return Count(true);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:4,代码来源:test_ext_class.cpp

示例7: f_get_declared_classes

bool TestExtClass::test_get_declared_classes() {
  Array classes = f_get_declared_classes();
  VS(f_in_array("test", classes, true), true);
  return Count(true);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:5,代码来源:test_ext_class.cpp

示例8: VERIFY

bool TestExtDatetime::test_timezone_identifiers_list() {
  //f_var_dump(TimeZone::GetNames());
  VERIFY(!TimeZone::GetNames().empty());
  return Count(true);
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:5,代码来源:test_ext_datetime.cpp

示例9: VS

bool TestExtDatetime::test_timezone_name_from_abbr() {
  VS(f_timezone_name_from_abbr("CET"), "Europe/Berlin");
  VS(f_timezone_name_from_abbr("", 3600, 0), "Europe/Paris");
  return Count(true);
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:5,代码来源:test_ext_datetime.cpp

示例10: f_microtime

bool TestExtDatetime::test_microtime() {
  int time_start = f_microtime(true);
  VERIFY(time_start > 0);
  return Count(true);
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:5,代码来源:test_ext_datetime.cpp

示例11: f_gmmktime

bool TestExtDatetime::test_gmmktime() {
  int d = f_gmmktime(0, 0, 0, 1, 1, 1998);
  VS(f_date("M d Y H:i:s",   d), "Dec 31 1997 16:00:00");
  VS(f_gmdate("M d Y H:i:s", d), "Jan 01 1998 00:00:00");
  return Count(true);
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:6,代码来源:test_ext_datetime.cpp

示例12: f_timezone_open

bool TestExtDatetime::test_date_timestamp_get() {
  Object tz = f_timezone_open("America/Los_Angeles");
  Object dt = f_date_create("2008-08-08 12:34:56", tz);
  VS(f_date_timestamp_get(dt), 1218224096);
  return Count(true);
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:6,代码来源:test_ext_datetime.cpp

示例13: f_get_declared_interfaces

bool TestExtClass::test_get_declared_interfaces() {
  Array classes = f_get_declared_interfaces();
  VS(f_in_array("itestable", classes, true), true);
  return Count(true);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:5,代码来源:test_ext_class.cpp

示例14: f_date_create_from_format

bool TestExtDatetime::test_date_create_from_format() {
  Object dt = f_date_create_from_format("d/m/Y H:i:s", "16/08/2012 00:00:00");
  VDT(dt, "2012-08-16 00:00:00");
  return Count(true);
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:5,代码来源:test_ext_datetime.cpp

示例15: if

/** \brief Add the specified words to this moWords object.
 *
 * This function adds words to the existing list of words.
 *
 * The new words are appened at the end of the existing
 * word list.
 *
 * The words are separated using the character and
 * string separators.
 *
 * \param[in] words   The list of words to append.
 *
 * \return The number of words in this moWords object.
 */
unsigned long moWords::AddWords(const moWCString& words)
{
	moWCString		str, *cmp;
	const mowc::wc_t	*s, *start, *seps;
	long			idx, max, skip;
	bool			found, accepts_backslash;

	if(!f_words.IsEmpty()) {
		if(!f_char_separators.IsEmpty()) {
			f_words += f_char_separators[0];
		}
		else if(f_str_separators.Count() != 0) {
			f_words += dynamic_cast<moWCString *>(f_str_separators.Get(0))[0];
		}
		else {
			// use a default separator (a space)
			f_words += " ";
		}
	}
	f_words += words;

	s = words.Data();
	while(*s != '\0') {
		// start of this new word
		start = s;
		found = false;
		do {
			skip = 1;

			// 1. test with strings
			max = f_str_separators.Count();
			idx = 0;
			while(idx < max) {
				cmp = dynamic_cast<moWCString *>(f_str_separators.Get(idx));
				if(cmp->Compare(s, 0, static_cast<int>(cmp->Length())) == MO_BASE_COMPARE_EQUAL) {
					// we found a separator
					found = true;
					skip = static_cast<long>(cmp->Length());
					break;
				}
				idx++;
			}

			// 2. test with characters (if not found yet)
			if(!found && !f_char_separators.IsEmpty()) {
				seps = f_char_separators.Data();
				while(*seps != '\0' && !found) {
					if(*seps == '\\') {
						seps++;
						if(*seps == 's') {
							found = mowc::isspace(*s);
							seps++;
						}
						else {
							found = *s == mowc::backslash_char(seps);
						}
					}
					else if(*seps == *s) {
						// we found a separator
						found = true;
						break;
					}
					else {
						seps++;
					}
				}
			}

			// 3. test with the default separators (spaces)
			if(!found && f_char_separators.IsEmpty() && f_str_separators.IsEmpty() && mowc::isspace(*s)) {
				// we found the default separator
				found = true;
			}

			// 4. check for quoted information
			if(!found) {
				accepts_backslash = false;
				seps = f_quotes.Data();
				while(*seps != '\0') {
					if(*seps == '\\') {
						accepts_backslash = true;
					}
					else if(*s == *seps) {
						// we found a quoted part - quoted parts can include separators
						s++;		// skip starting quote
						while(*s != seps[1] && *s != '\0') {
//.........这里部分代码省略.........
开发者ID:m2osw,项目名称:turnwatcher,代码行数:101,代码来源:words.cpp


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