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


C++ Footer类代码示例

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


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

示例1: sizeof

void* Allocator::_Realloc(void* ptr, size_t size, const char* file_name, unsigned int line_num)
{
	//LOG("%s:%d  realloc(%p, %d)\n", file_name, line_num, ptr, size);

	byte* pBlock = (byte*)ptr - sizeof(Header);
	Header* pHeader = reinterpret_cast<Header*>(pBlock);
	Footer* pFooter = reinterpret_cast<Footer*>((byte*)ptr+size);

	ASSERT(pHeader->m_pBlockNode != NULL);
	BlockNode* pNode = pHeader->m_pBlockNode;

	size_t total = size + sizeof(Header) + sizeof(Footer);
	pBlock = (byte*)realloc(pBlock, total);
	ptr = pBlock + sizeof(Header);

	pHeader = reinterpret_cast<Header*>(pBlock);
	pFooter = reinterpret_cast<Footer*>((byte*)ptr+size);

	pHeader->Init(size, file_name, line_num);
	pFooter->Init(size, file_name, line_num);

	pNode->pBlock = pBlock;
	pHeader->m_pBlockNode = pNode;
	
	return ptr;
}
开发者ID:beanhome,项目名称:dev,代码行数:26,代码来源:Allocator.cpp

示例2: GetFooter

result BaseForm::OnInitializing(void)
{
	result r = E_SUCCESS;
	Footer* footer = GetFooter();
	footer->AddActionEventListener(*this);
	return r;
}
开发者ID:mike-hmelov,项目名称:smsBackup,代码行数:7,代码来源:BaseForm.cpp

示例3: GetHeader

void
OverlayKeypadForm::OnKeypadClosed(Control& source)
{
	Header* pHeader = GetHeader();
	pHeader->SetStyle(HEADER_STYLE_TITLE);
	pHeader->SetTitleText(L"OverlayKeypad");
	Footer* pFooter = GetFooter();
	pFooter->SetShowState(true);
	Invalidate(true);
}
开发者ID:justinkchen,项目名称:giraffe,代码行数:10,代码来源:OverlayKeypadForm.cpp

示例4: Open

Status Table::Open(const Options& options,
                   RandomAccessFile* file,
                   uint64_t size,
                   Table** table) {
  *table = NULL;
  if (size < Footer::kEncodedLength) {
    return Status::Corruption("file is too short to be an sstable");
  }

  char footer_space[Footer::kEncodedLength];
  Slice footer_input;
  Status s = file->Read(size - Footer::kEncodedLength, Footer::kEncodedLength,
                        &footer_input, footer_space);
  if (!s.ok()) return s;

  Footer footer;
  s = footer.DecodeFrom(&footer_input);
  if (!s.ok()) return s;

  // Read the index block
  BlockContents contents;
  Block* index_block = NULL;
  if (s.ok()) {
    ReadOptions opt;
    if (options.paranoid_checks) {
      opt.verify_checksums = true;
    }
    s = ReadBlock(file, opt, footer.index_handle(), &contents);
    if (s.ok()) {
      index_block = new Block(contents);
    }
  }

  if (s.ok()) {
    // We've successfully read the footer and the index block: we're
    // ready to serve requests.
    Rep* rep = new Table::Rep;
    rep->options = options;
    rep->file = file;
    rep->metaindex_handle = footer.metaindex_handle();
    rep->index_block = index_block;
    rep->cache_id = (options.block_cache ? options.block_cache->NewId() : 0);
    rep->filter_data = NULL;
    rep->filter = NULL;
    *table = new Table(rep);
    (*table)->ReadMeta(footer);
  } else {
    delete index_block;
  }

  return s;
}
开发者ID:yanxi10,项目名称:leveldblib,代码行数:52,代码来源:table.cpp

示例5: switch

void BaseWordForm::OnActionPerformed(const Osp::Ui::Control& source, int actionId)
{
	switch (actionId)
	{
	case ID_ADD_WORD:
	{
		if (__pAddWordDlg)
			delete __pAddWordDlg;

		__pAddWordDlg = new AddWord();
		__pAddWordDlg->ShowPopup(this);

		break;
	}
	case ID_MENU:
	{
		int hp = 0;
		int wp = 0;
		Header *header = GetHeader();

		if (header)
		{
			int posy = GetBounds().height - GetClientAreaBounds().height;

			Footer * footer = GetFooter();
			if (footer)
				posy -= footer->GetHeight();

			hp = (posy - 10);
			wp = header->GetWidth() - 10;
		}
		// Set the anchor position of the ContextMenu
		__pContextMenu->SetPosition(Point(wp, hp));

		// Show the ContextMenu
		__pContextMenu->SetShowState(true);
		__pContextMenu->Show();

		break;
	}
	case ID_DICTIONARY:
	{
		ShowDictionary();
		break;
	}
	case ID_MENU_INFO:
	{
		ShowInfoDlg();
		break;
	}
	}
}
开发者ID:m1uan,项目名称:voc4u_bada,代码行数:52,代码来源:BaseWordForm.cpp

示例6: GetFooter

result ItemForm::OnInitializing(void) {
	result r = E_SUCCESS;

	Footer * pFooter = GetFooter();
	pFooter->AddActionEventListener(*this);

	SetFormBackEventListener(this);

	pTitleLabel = static_cast<Label *>(GetControl(L"IDC_LABEL_TITLE"));
	pDateAuthorLabel = static_cast<Label *>(GetControl(L"IDC_LABEL_AUTHOR_DATE"));
	pSnippetLabel = static_cast<Label *>(GetControl(L"IDC_LABEL_SNIPPET"));

	return r;
}
开发者ID:drstrangecode,项目名称:Bada_RssReader_DrStrangecode,代码行数:14,代码来源:ItemForm.cpp

示例7: _Check

bool Allocator::_Check() const
{
	bool res = true;

	for (BlockNode* pNode = m_pBlocks ; pNode != NULL ; pNode = pNode->pNext)
	{
		Header* pHeader = reinterpret_cast<Header*>(pNode->pBlock);
		Footer* pFooter = reinterpret_cast<Footer*>(pNode->pBlock+sizeof(Header)+pHeader->m_iSize);

		res &= pHeader->Check();
		res &= pFooter->Check();
	}

	return true;
}
开发者ID:beanhome,项目名称:dev,代码行数:15,代码来源:Allocator.cpp

示例8: ReadMeta

void Table::ReadMeta(const Footer& footer) {
  if (rep_->options.filter_policy == NULL) {
    return;  // Do not need any metadata
  }

  // TODO(sanjay): Skip this if footer.metaindex_handle() size indicates
  // it is an empty block.
  ReadOptions opt;
  if (rep_->options.paranoid_checks) {
    opt.verify_checksums = true;
  }
  BlockContents contents;
  if (!ReadBlock(rep_->file, opt, footer.metaindex_handle(), &contents).ok()) {
    // Do not propagate errors since meta info is not needed for operation
    return;
  }
  Block* meta = new Block(contents);

  Iterator* iter = meta->NewIterator(BytewiseComparator());
  std::string key = "filter.";
  key.append(rep_->options.filter_policy->Name());
  iter->Seek(key);
  if (iter->Valid() && iter->key() == Slice(key)) {
    ReadFilter(iter->value());
  }
  delete iter;
  delete meta;
}
开发者ID:yanxi10,项目名称:leveldblib,代码行数:28,代码来源:table.cpp

示例9: GetFormStyle

bool
CustomHybridForm::Initialize()
{
	NativeBridgeForm::Initialize();

	unsigned long style = GetFormStyle();
	Footer* pFooter;

	if (style & FORM_STYLE_FOOTER)
	{
		pFooter = GetFooter();
		pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
		ButtonItem btnCharac;
		btnCharac.Construct(BUTTON_ITEM_STYLE_TEXT, ID_BUTTON_CHARAC);
		btnCharac.SetText("envoi au JS des caractères spéciaux");
		pFooter->SetButton(BUTTON_POSITION_RIGHT, btnCharac);
		pFooter->AddActionEventListener(*this);
	}

	return true;
}
开发者ID:Alexandre-LePoupon,项目名称:cobalt,代码行数:21,代码来源:CustomHybridForm.cpp

示例10: GetFooter

void
QuickPanelFrameForm::SetFooter()
{
	 Footer* pFooter = GetFooter();
	 if (pFooter)
	 {
		FooterItem  footerItem1;
		footerItem1.Construct(ID_FOOTER_ITEM1);
		footerItem1.SetText(L"Attached");

		FooterItem  footerItem2;
		footerItem2.Construct(ID_FOOTER_ITEM2);
		footerItem2.SetText(L"Detached");

		pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_TEXT);
		pFooter->AddItem(footerItem1);
		pFooter->AddItem(footerItem2);
		pFooter->AddActionEventListener(*this);
		pFooter->SetBackButton();
	 }
}
开发者ID:justinkchen,项目名称:giraffe,代码行数:21,代码来源:QuickPanelFrameForm.cpp

示例11: GetFooter

result
CropForm::OnInitializing(void)
{
	result r = E_SUCCESS;

	Footer *pFooter = GetFooter();
	if(pFooter)
	{
		pFooter->AddActionEventListener(*this);
		SetFormBackEventListener(this);
	}

	AddTouchEventListener(*this);

	//initialize to extreme values
	__x_min = GetClientAreaBounds().width;
	__y_min = GetClientAreaBounds().height;
	__x_max = 0;
	__y_max = 0;
	return r;
}
开发者ID:CoCoTeam,项目名称:TizenGameHub,代码行数:21,代码来源:CropForm.cpp

示例12: GetFooter

result
LocationMapForm::OnInitializing(void)
{
	result r = E_SUCCESS;

	Footer* pFooter = GetFooter();
	AppAssert(pFooter);
	pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);

	FooterItem footerSave;
	footerSave.Construct(ID_BUTTON_SELECT);
	String getSelect;
	Application::GetInstance()->GetAppResource()->GetString(IDS_SELECT, getSelect);
	footerSave.SetText(getSelect);
	pFooter->AddItem(footerSave);
	pFooter->AddActionEventListener(*this);

	__pWeb = new (std::nothrow) Web();

	Rectangle bound = this->GetClientAreaBounds();


	__pWeb->Construct( Rectangle ( 0 , 0  , bound.width , bound.height));

	Tizen::Base::String url = "file://"+App::GetInstance()->GetAppDataPath() + L"index.html";
	__pWeb->SetLoadingListener(this);
	__pWeb->SetWebUiEventListener(this);
	__pWeb->AddJavaScriptBridge(*this);
	this->AddControl(__pWeb);

	SetFormBackEventListener(this);

	__pWeb->LoadUrl(url);

	this->RequestRedraw(true);

	return r;
}
开发者ID:PassionJHack,项目名称:passion,代码行数:38,代码来源:LocationMapForm.cpp

示例13: GetBounds

result BaseWordForm::OnDraw(void)
{
	result r = Form::OnDraw();
	Rectangle bound = GetBounds();
	Canvas * canvas = GetCanvasN(bound);

	if (!__pBGLogo)
		__pBGLogo = Utils::GetBitmapN("bg_logo.png");

	int x = bound.width / 2 - (__pBGLogo->GetWidth() / 2);
	int y = bound.height - __pBGLogo->GetHeight() - 15;

	Footer * footer = GetFooter();
	if (footer)
	{
		y -= footer->GetHeight();
	}

	canvas->DrawBitmap(Point(x, y), *__pBGLogo);

	delete canvas;

	return r;
}
开发者ID:m1uan,项目名称:voc4u_bada,代码行数:24,代码来源:BaseWordForm.cpp

示例14: GetFooter

void BaseWordForm::PrepareFooter()
{
	Footer *footer = GetFooter();

	if (footer)
	{
		// cleaning because function can be call
		// from SetBackForm
		footer->RemoveAllButtons();
		footer->RemoveAllItems();
		footer->RemoveBackButton();

		if (__pBackForm)
		{
			footer->SetBackButton();
			footer->SetBackButtonEnabled(true);
			SetFormBackEventListener(this);
		}
		footer->AddActionEventListener(*this);
	}

}
开发者ID:m1uan,项目名称:voc4u_bada,代码行数:22,代码来源:BaseWordForm.cpp

示例15: GetHeader

result
EventListForm::OnInitializing(void)
{
	result r = E_SUCCESS;

	Header* pHeader = GetHeader();
	AppAssert(pHeader);

	DateTime today;
	String formattedString;

	SystemTime::GetCurrentTime(WALL_TIME, today);

	__pLocaleCalendar = Tizen::Locales::Calendar::CreateInstanceN(CALENDAR_GREGORIAN);
	__pLocaleCalendar->SetTime(today);
	DateTimeFormatter* pDateFormatter = DateTimeFormatter::CreateDateFormatterN(DATE_TIME_STYLE_DEFAULT);

	String customizedPattern = L"dd MMM yyyy";
	pDateFormatter->ApplyPattern(customizedPattern);
	pDateFormatter->Format(*__pLocaleCalendar, formattedString);

	HeaderItem headerDaily;
	headerDaily.Construct(ID_HEADER_DAILY);
	headerDaily.SetText(L"일");

	HeaderItem headerMonthly;
	headerMonthly.Construct(ID_HEADER_MONTHLY);
	headerMonthly.SetText(L"월");

	pHeader->SetStyle(HEADER_STYLE_SEGMENTED_WITH_TITLE);
	pHeader->SetTitleText(formattedString);
	pHeader->AddItem(headerDaily);
	pHeader->AddItem(headerMonthly);
	pHeader->AddActionEventListener(*this);

	Footer* pFooter = GetFooter();
	AppAssert(pFooter);
	pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);

	FooterItem footerCreate;
	footerCreate.Construct(ID_FOOTER_CREATE);
	footerCreate.SetText(L"일정 생성");
	pFooter->AddItem(footerCreate);

	SetFormBackEventListener(this);
	pFooter->AddActionEventListener(*this);

	Tizen::Ui::Controls::Button* pPreviousButton = new (std::nothrow) Button();
	pPreviousButton->Construct(Rectangle(0, 0, GetClientAreaBounds().width / 2, 72), L"이전");
	pPreviousButton->SetActionId(ID_BUTTON_PREV);
	pPreviousButton->AddActionEventListener(*this);
	AddControl(pPreviousButton);

	Tizen::Ui::Controls::Button* pNextButton = new (std::nothrow) Button();
	pNextButton->Construct(Rectangle(GetClientAreaBounds().width / 2, 0, GetClientAreaBounds().width / 2, 72), L"다음");
	pNextButton->SetActionId(ID_BUTTON_NEXT);
	pNextButton->AddActionEventListener(*this);
	AddControl(pNextButton);

	__pGroupedListView = new (std::nothrow) GroupedListView();
	__pGroupedListView->Construct(Rectangle(0, 72, GetClientAreaBounds().width, GetClientAreaBounds().height - 72), GROUPED_LIST_VIEW_STYLE_INDEXED, true, SCROLL_STYLE_FADE_OUT);
	__pGroupedListView->SetTextOfEmptyList(L"일정 없음");
	__pGroupedListView->SetItemProvider(*this);
	__pGroupedListView->AddGroupedListViewItemEventListener(*this);
	__pGroupedListView->SetItemDividerColor(Tizen::Graphics::Color::GetColor(COLOR_ID_BLACK));
	AddControl(__pGroupedListView);

	LocaleManager localeManager;
	localeManager.Construct();
	__timeZone = localeManager.GetSystemTimeZone();

	return r;
}
开发者ID:minicho,项目名称:TIZEN5-,代码行数:73,代码来源:EventListForm.cpp


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