本文整理汇总了C++中std::wstring::front方法的典型用法代码示例。如果您正苦于以下问题:C++ wstring::front方法的具体用法?C++ wstring::front怎么用?C++ wstring::front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::wstring
的用法示例。
在下文中一共展示了wstring::front方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetPlaceDistributionPolicy
void Service::SetPlaceDistributionPolicy(std::wstring const& distPolicy)
{
if (distPolicy.front() == L'N' || distPolicy.front() == L'n')
{
this->partiallyPlace_ = false;
}
else
{
this->partiallyPlace_ = true;
}
}
示例2:
PictureElement(sf::Texture& texture, sf::IntRect textureSectionRect,
int index, std::wstring word, sf::Vector2f pos )
: missed_(false)
, revealed_(false)
, active_(false)
, index_(index)
, word_(word)
, nextLetter_(word.front())
//, scheduler_(sf::seconds(3.f), []() { })
{
const int charFontSize {22};
const int charWidth {14};
const int charHeight {24};
sprite_.setTexture(texture);
sprite_.setTextureRect(textureSectionRect);
sprite_.setPosition(pos);
wordText_.setFont(framework::ResourceHolder::get().fonts.get("arial"));
wordText_.setPosition(sf::Vector2f(
pos.x + sprite_.getTextureRect().width / 2.f ,
pos.y + sprite_.getTextureRect().height/ 2.f));
wordText_.setString(word);
wordText_.setCharacterSize(charFontSize);
//wordText_.setColor(sf::Color::White);
wordText_.setStyle(sf::Text::Bold);
wordText_.setOrigin(0, 0);
//timer_.restart();
//shape.setSize(sf::Vector2f(word.length() * charWidth, charHeight));
LOG_INFO("PictureElement:" << word_);
}
示例3: RangeFromString
ItRange<uint16_t*> RangeFromString(std::wstring& str) {
auto s = reinterpret_cast<uint16_t*>(&str.front());
return ItRange<uint16_t*>(s, s + str.size());
}