Use std::string_view for strings
This commit is contained in:
@@ -22,7 +22,7 @@ namespace Nz
|
||||
~NodeComponent() = default;
|
||||
|
||||
void SetParent(entt::handle entity, bool keepDerived = false);
|
||||
void SetParentJoint(entt::handle entity, const std::string& jointName, bool keepDerived = false);
|
||||
void SetParentJoint(entt::handle entity, std::string_view jointName, bool keepDerived = false);
|
||||
void SetParentJoint(entt::handle entity, std::size_t jointIndex, bool keepDerived = false);
|
||||
using Node::SetParent;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Nz
|
||||
SkeletonComponentBase(SkeletonComponentBase&&) noexcept = default;
|
||||
~SkeletonComponentBase() = default;
|
||||
|
||||
inline std::size_t FindJointByName(const std::string& jointName) const;
|
||||
inline std::size_t FindJointByName(std::string_view jointName) const;
|
||||
|
||||
inline const Joint& GetAttachedJoint(std::size_t jointIndex) const;
|
||||
inline const std::shared_ptr<Skeleton>& GetSkeleton() const;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Nz
|
||||
{
|
||||
}
|
||||
|
||||
inline std::size_t SkeletonComponentBase::FindJointByName(const std::string& jointName) const
|
||||
inline std::size_t SkeletonComponentBase::FindJointByName(std::string_view jointName) const
|
||||
{
|
||||
return m_referenceSkeleton->GetJointIndex(jointName);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Nz
|
||||
inline void ConnectFontSlots();
|
||||
inline void DisconnectFontSlots();
|
||||
bool GenerateGlyph(Glyph& glyph, char32_t character, float outlineThickness, bool lineWrap, const Font& font, const Color& color, TextStyleFlags style, float lineSpacingOffset, unsigned int characterSize, int renderOrder, int* advance) const;
|
||||
void GenerateGlyphs(const Font& font, const Color& color, TextStyleFlags style, unsigned int characterSize, const Color& outlineColor, float characterSpacingOffset, float lineSpacingOffset, float outlineThickness, const std::string& text) const;
|
||||
void GenerateGlyphs(const Font& font, const Color& color, TextStyleFlags style, unsigned int characterSize, const Color& outlineColor, float characterSpacingOffset, float lineSpacingOffset, float outlineThickness, std::string_view text) const;
|
||||
inline float GetLineHeight(const Block& block) const;
|
||||
inline float GetLineHeight(float lineSpacingOffset, const Font::SizeInfo& sizeInfo) const;
|
||||
inline std::size_t HandleFontAddition(const std::shared_ptr<Font>& font);
|
||||
|
||||
Reference in New Issue
Block a user