[glom] C++11: Some use of noexcept on simple methods.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] C++11: Some use of noexcept on simple methods.
- Date: Thu, 20 Aug 2015 19:38:31 +0000 (UTC)
commit 6ce079b70a568a37951361bb99087aa7b0db677c
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Aug 20 21:14:25 2015 +0200
C++11: Some use of noexcept on simple methods.
And added some missing override keywords that I noticed along the way.
glom/libglom/data_structure/choicevalue.cc | 2 +-
glom/libglom/data_structure/choicevalue.h | 2 +-
glom/libglom/data_structure/field.cc | 4 +-
glom/libglom/data_structure/field.h | 4 +-
glom/libglom/data_structure/foundset.cc | 2 +-
glom/libglom/data_structure/foundset.h | 4 +-
.../data_structure/layout/layoutitem_field.cc | 8 ++--
.../data_structure/layout/layoutitem_field.h | 8 ++--
.../data_structure/layout/layoutitem_portal.cc | 4 +-
.../data_structure/layout/layoutitem_portal.h | 4 +-
.../layout/report_parts/layoutitem_fieldsummary.cc | 4 +-
.../layout/report_parts/layoutitem_fieldsummary.h | 4 +-
glom/libglom/data_structure/tableinfo.cc | 18 ++++----
glom/libglom/data_structure/tableinfo.h | 18 ++++----
glom/libglom/data_structure/translatable_item.cc | 46 +++++++++---------
glom/libglom/data_structure/translatable_item.h | 48 ++++++++++----------
16 files changed, 90 insertions(+), 90 deletions(-)
---
diff --git a/glom/libglom/data_structure/choicevalue.cc b/glom/libglom/data_structure/choicevalue.cc
index 0f33400..0bbce7f 100644
--- a/glom/libglom/data_structure/choicevalue.cc
+++ b/glom/libglom/data_structure/choicevalue.cc
@@ -77,7 +77,7 @@ Gnome::Gda::Value ChoiceValue::get_value() const
return m_value;
}
-Glib::ustring ChoiceValue::get_title_original() const
+Glib::ustring ChoiceValue::get_title_original() const noexcept
{
return m_value.to_string();
}
diff --git a/glom/libglom/data_structure/choicevalue.h b/glom/libglom/data_structure/choicevalue.h
index 3df6792..a63ecd5 100644
--- a/glom/libglom/data_structure/choicevalue.h
+++ b/glom/libglom/data_structure/choicevalue.h
@@ -58,7 +58,7 @@ public:
* assuming that the value is a title,
* if it is a text value.
*/
- virtual Glib::ustring get_title_original() const override;
+ virtual Glib::ustring get_title_original() const noexcept override;
/** Whether the value is of a type that can be translated.
* This means that it must be a text type.
diff --git a/glom/libglom/data_structure/field.cc b/glom/libglom/data_structure/field.cc
index 7b41b88..dd7ed88 100644
--- a/glom/libglom/data_structure/field.cc
+++ b/glom/libglom/data_structure/field.cc
@@ -469,12 +469,12 @@ Gnome::Gda::SqlOperatorType Field::sql_find_operator() const
}
-Glib::ustring Field::get_name() const
+Glib::ustring Field::get_name() const noexcept
{
return m_field_info->get_name();
}
-void Field::set_name(const Glib::ustring& value)
+void Field::set_name(const Glib::ustring& value) noexcept
{
m_field_info->set_name(value);
}
diff --git a/glom/libglom/data_structure/field.h b/glom/libglom/data_structure/field.h
index 7a59688..c5ae566 100644
--- a/glom/libglom/data_structure/field.h
+++ b/glom/libglom/data_structure/field.h
@@ -90,10 +90,10 @@ public:
/// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_name, so that we can use it in the same
std::find_if lambda.
- virtual Glib::ustring get_name() const;
+ Glib::ustring get_name() const noexcept override;
/// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_name, for convenience
- virtual void set_name(const Glib::ustring& value);
+ void set_name(const Glib::ustring& value) noexcept override;
/// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_auto_increment.
bool get_auto_increment() const;
diff --git a/glom/libglom/data_structure/foundset.cc b/glom/libglom/data_structure/foundset.cc
index e93cd0b..0d562ea 100644
--- a/glom/libglom/data_structure/foundset.cc
+++ b/glom/libglom/data_structure/foundset.cc
@@ -23,7 +23,7 @@
namespace Glom
{
-FoundSet::FoundSet()
+FoundSet::FoundSet() noexcept
{
}
diff --git a/glom/libglom/data_structure/foundset.h b/glom/libglom/data_structure/foundset.h
index fc3ebe3..6657837 100644
--- a/glom/libglom/data_structure/foundset.h
+++ b/glom/libglom/data_structure/foundset.h
@@ -40,13 +40,13 @@ public:
FoundSet() noexcept;
FoundSet(const FoundSet& src) noexcept;
FoundSet(FoundSet&& src) noexcept;
- FoundSet& operator=(const FoundSet& src);
+ FoundSet& operator=(const FoundSet& src) noexcept;
FoundSet& operator=(FoundSet&& src) noexcept;
private:
//We cannot implement this without a way to compare GdaSqlExpr instances,
//but luckily we don't need to compare FoundSet instances anyway.
- bool operator==(const FoundSet& src) const;
+ bool operator==(const FoundSet& src) const noexcept;
public:
Glib::ustring m_table_name;
diff --git a/glom/libglom/data_structure/layout/layoutitem_field.cc
b/glom/libglom/data_structure/layout/layoutitem_field.cc
index a838012..1ef2da8 100644
--- a/glom/libglom/data_structure/layout/layoutitem_field.cc
+++ b/glom/libglom/data_structure/layout/layoutitem_field.cc
@@ -102,7 +102,7 @@ LayoutItem_Field& LayoutItem_Field::operator=(const LayoutItem_Field& src)
return *this;
}
-void LayoutItem_Field::set_name(const Glib::ustring& name)
+void LayoutItem_Field::set_name(const Glib::ustring& name) noexcept
{
if(get_name() != name)
m_field_cache_valid = false;
@@ -110,7 +110,7 @@ void LayoutItem_Field::set_name(const Glib::ustring& name)
LayoutItem_WithFormatting::set_name(name);
}
-Glib::ustring LayoutItem_Field::get_name() const
+Glib::ustring LayoutItem_Field::get_name() const noexcept
{
return LayoutItem_WithFormatting::get_name();
}
@@ -148,7 +148,7 @@ Glib::ustring LayoutItem_Field::get_title_or_name_no_custom(const Glib::ustring&
return Glib::ustring();
}
-Glib::ustring LayoutItem_Field::get_title(const Glib::ustring& locale) const
+Glib::ustring LayoutItem_Field::get_title(const Glib::ustring& locale) const noexcept
{
//Use the custom title (overriding the field's default title), if there is one:
//This may even be empty if the developer specifies that.
@@ -161,7 +161,7 @@ Glib::ustring LayoutItem_Field::get_title(const Glib::ustring& locale) const
return get_title_no_custom(locale);
}
-Glib::ustring LayoutItem_Field::get_title_or_name(const Glib::ustring& locale) const
+Glib::ustring LayoutItem_Field::get_title_or_name(const Glib::ustring& locale) const noexcept
{
//Use the custom title (overriding the field's default title), if there is one:
//This may even be empty if the developer specifies that.
diff --git a/glom/libglom/data_structure/layout/layoutitem_field.h
b/glom/libglom/data_structure/layout/layoutitem_field.h
index 935c172..b88065d 100644
--- a/glom/libglom/data_structure/layout/layoutitem_field.h
+++ b/glom/libglom/data_structure/layout/layoutitem_field.h
@@ -59,20 +59,20 @@ public:
/** Set the non-user-visible name of the field.
*/
- virtual void set_name(const Glib::ustring& name);
+ void set_name(const Glib::ustring& name) noexcept override;
/** Get the non-user-visible name of the field.
*/
- virtual Glib::ustring get_name() const; //For use with our std::find_if() lambda.
+ Glib::ustring get_name() const noexcept override; //For use with our std::find_if() lambda.
/** Get the user-visible title for the field, in the user's current locale.
* This returns the name if no title is set.
*/
- virtual Glib::ustring get_title(const Glib::ustring& locale) const;
+ Glib::ustring get_title(const Glib::ustring& locale) const noexcept override;
/** Get the user-visible title for the field, in the user's current locale.
*/
- virtual Glib::ustring get_title_or_name(const Glib::ustring& locale) const;
+ Glib::ustring get_title_or_name(const Glib::ustring& locale) const noexcept override;
Glib::ustring get_title_or_name_no_custom(const Glib::ustring& locale) const;
diff --git a/glom/libglom/data_structure/layout/layoutitem_portal.cc
b/glom/libglom/data_structure/layout/layoutitem_portal.cc
index 467ef89..d4208f3 100644
--- a/glom/libglom/data_structure/layout/layoutitem_portal.cc
+++ b/glom/libglom/data_structure/layout/layoutitem_portal.cc
@@ -403,7 +403,7 @@ std::shared_ptr<const LayoutItem_Field> LayoutItem_Portal::get_field_identifies_
return result;
}
-Glib::ustring LayoutItem_Portal::get_title_or_name(const Glib::ustring& locale) const
+Glib::ustring LayoutItem_Portal::get_title_or_name(const Glib::ustring& locale) const noexcept
{
auto title = get_title_used(Glib::ustring() /* parent table - not relevant */, locale);
if(title.empty())
@@ -415,7 +415,7 @@ Glib::ustring LayoutItem_Portal::get_title_or_name(const Glib::ustring& locale)
return title;
}
-Glib::ustring LayoutItem_Portal::get_title(const Glib::ustring& locale) const
+Glib::ustring LayoutItem_Portal::get_title(const Glib::ustring& locale) const noexcept
{
auto title = get_title_used(Glib::ustring() /* parent table - not relevant */, locale);
if(title.empty()) //TODO: This prevents "" as a real title.
diff --git a/glom/libglom/data_structure/layout/layoutitem_portal.h
b/glom/libglom/data_structure/layout/layoutitem_portal.h
index 1ecc5e4..1edf3e0 100644
--- a/glom/libglom/data_structure/layout/layoutitem_portal.h
+++ b/glom/libglom/data_structure/layout/layoutitem_portal.h
@@ -54,8 +54,8 @@ public:
virtual LayoutItem* clone() const;
- virtual Glib::ustring get_title(const Glib::ustring& locale) const;
- virtual Glib::ustring get_title_or_name(const Glib::ustring& locale) const;
+ Glib::ustring get_title(const Glib::ustring& locale) const noexcept override;
+ Glib::ustring get_title_or_name(const Glib::ustring& locale) const noexcept override;
//We do not implement this, because we only ever want to use the method
//in the derived class.
diff --git a/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.cc
b/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.cc
index aa9d7f6..229f056 100644
--- a/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.cc
+++ b/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.cc
@@ -59,14 +59,14 @@ LayoutItem_FieldSummary& LayoutItem_FieldSummary::operator=(const LayoutItem_Fie
return *this;
}
-Glib::ustring LayoutItem_FieldSummary::get_title_or_name(const Glib::ustring& locale) const
+Glib::ustring LayoutItem_FieldSummary::get_title_or_name(const Glib::ustring& locale) const noexcept
{
const auto field_title = get_full_field_details()->get_title_or_name(locale);
return get_summary_type_name(m_summary_type) + ": " + field_title; //TODO: Allow a more human-readable
title for summary headings.
}
-Glib::ustring LayoutItem_FieldSummary::get_title(const Glib::ustring& locale) const
+Glib::ustring LayoutItem_FieldSummary::get_title(const Glib::ustring& locale) const noexcept
{
const auto field_title = get_full_field_details()->get_title(locale);
diff --git a/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.h
b/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.h
index 856cb61..4ca2822 100644
--- a/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.h
+++ b/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.h
@@ -63,8 +63,8 @@ public:
void set_field(const std::shared_ptr<LayoutItem_Field>& field);
- virtual Glib::ustring get_title(const Glib::ustring& locale) const;
- virtual Glib::ustring get_title_or_name(const Glib::ustring& locale) const;
+ Glib::ustring get_title(const Glib::ustring& locale) const noexcept override;
+ Glib::ustring get_title_or_name(const Glib::ustring& locale) const noexcept override;
virtual Glib::ustring get_layout_display_name() const;
diff --git a/glom/libglom/data_structure/tableinfo.cc b/glom/libglom/data_structure/tableinfo.cc
index 48cae40..83feb2c 100644
--- a/glom/libglom/data_structure/tableinfo.cc
+++ b/glom/libglom/data_structure/tableinfo.cc
@@ -23,14 +23,14 @@
namespace Glom
{
-TableInfo::TableInfo()
+TableInfo::TableInfo() noexcept
: m_hidden(false),
m_default(false)
{
m_translatable_item_type = TRANSLATABLE_TYPE_TABLE;
}
-TableInfo::TableInfo(const TableInfo& src)
+TableInfo::TableInfo(const TableInfo& src) noexcept
: TranslatableItem(src),
HasTitleSingular(src),
m_hidden(src.m_hidden),
@@ -38,7 +38,7 @@ TableInfo::TableInfo(const TableInfo& src)
{
}
-TableInfo& TableInfo::operator=(const TableInfo& src)
+TableInfo& TableInfo::operator=(const TableInfo& src) noexcept
{
TranslatableItem::operator=(src);
HasTitleSingular::operator=(src);
@@ -49,7 +49,7 @@ TableInfo& TableInfo::operator=(const TableInfo& src)
return *this;
}
-bool TableInfo::operator==(const TableInfo& src) const
+bool TableInfo::operator==(const TableInfo& src) const noexcept
{
return TranslatableItem::operator==(src) &&
HasTitleSingular::operator==(src) &&
@@ -57,27 +57,27 @@ bool TableInfo::operator==(const TableInfo& src) const
(m_default == src.m_default);
}
-bool TableInfo::operator!=(const TableInfo& src) const
+bool TableInfo::operator!=(const TableInfo& src) const noexcept
{
return !operator==(src);
}
-bool TableInfo::get_hidden() const
+bool TableInfo::get_hidden() const noexcept
{
return m_hidden;
}
-void TableInfo::set_hidden(bool val)
+void TableInfo::set_hidden(bool val) noexcept
{
m_hidden = val;
}
-bool TableInfo::get_default() const
+bool TableInfo::get_default() const noexcept
{
return m_default;
}
-void TableInfo::set_default(bool val)
+void TableInfo::set_default(bool val) noexcept
{
m_default = val;
}
diff --git a/glom/libglom/data_structure/tableinfo.h b/glom/libglom/data_structure/tableinfo.h
index a3043f1..842a7f1 100644
--- a/glom/libglom/data_structure/tableinfo.h
+++ b/glom/libglom/data_structure/tableinfo.h
@@ -32,31 +32,31 @@ class TableInfo
public HasTitleSingular
{
public:
- TableInfo();
- TableInfo(const TableInfo& src);
+ TableInfo() noexcept;
+ TableInfo(const TableInfo& src) noexcept;
TableInfo(TableInfo&& src) = delete;
- TableInfo& operator=(const TableInfo& src);
+ TableInfo& operator=(const TableInfo& src) noexcept;
TableInfo& operator=(TableInfo&& src) = delete;
- bool operator==(const TableInfo& src) const;
- bool operator!=(const TableInfo& src) const;
+ bool operator==(const TableInfo& src) const noexcept;
+ bool operator!=(const TableInfo& src) const noexcept;
/** Returns true if this table should not be shown in the list of tables when in operator mode.
*/
- bool get_hidden() const;
+ bool get_hidden() const noexcept;
/** See get_default().
*/
- void set_hidden(bool val = true);
+ void set_hidden(bool val = true) noexcept;
/** Returns true if this table should be shown when the system is opened.
* Only one table can be the default table.
*/
- bool get_default() const;
+ bool get_default() const noexcept;
/** See get_default().
*/
- void set_default(bool val = true);
+ void set_default(bool val = true) noexcept;
private:
bool m_hidden;
diff --git a/glom/libglom/data_structure/translatable_item.cc
b/glom/libglom/data_structure/translatable_item.cc
index 36c9174..d2a92d7 100644
--- a/glom/libglom/data_structure/translatable_item.cc
+++ b/glom/libglom/data_structure/translatable_item.cc
@@ -26,12 +26,12 @@
namespace Glom
{
-TranslatableItem::TranslatableItem()
+TranslatableItem::TranslatableItem() noexcept
: m_translatable_item_type(TRANSLATABLE_TYPE_INVALID)
{
}
-TranslatableItem::TranslatableItem(const TranslatableItem& src)
+TranslatableItem::TranslatableItem(const TranslatableItem& src) noexcept
: m_translatable_item_type(src.m_translatable_item_type),
m_name(src.m_name),
m_title(src.m_title),
@@ -39,7 +39,7 @@ TranslatableItem::TranslatableItem(const TranslatableItem& src)
{
}
-TranslatableItem::TranslatableItem(TranslatableItem&& src)
+TranslatableItem::TranslatableItem(TranslatableItem&& src) noexcept
: m_translatable_item_type(std::move(src.m_translatable_item_type)),
m_name(std::move(src.m_name)),
m_title(std::move(src.m_title)),
@@ -51,7 +51,7 @@ TranslatableItem::~TranslatableItem()
{
}
-TranslatableItem& TranslatableItem::operator=(const TranslatableItem& src)
+TranslatableItem& TranslatableItem::operator=(const TranslatableItem& src) noexcept
{
m_name = src.m_name;
m_title = src.m_title;
@@ -61,7 +61,7 @@ TranslatableItem& TranslatableItem::operator=(const TranslatableItem& src)
return *this;
}
-TranslatableItem& TranslatableItem::operator=(TranslatableItem&& src)
+TranslatableItem& TranslatableItem::operator=(TranslatableItem&& src) noexcept
{
m_name = std::move(src.m_name);
m_title = std::move(src.m_title);
@@ -71,7 +71,7 @@ TranslatableItem& TranslatableItem::operator=(TranslatableItem&& src)
return *this;
}
-bool TranslatableItem::operator==(const TranslatableItem& src) const
+bool TranslatableItem::operator==(const TranslatableItem& src) const noexcept
{
bool bResult = (m_name == src.m_name)
&& (m_title == src.m_title)
@@ -81,12 +81,12 @@ bool TranslatableItem::operator==(const TranslatableItem& src) const
return bResult;
}
-bool TranslatableItem::operator!=(const TranslatableItem& src) const
+bool TranslatableItem::operator!=(const TranslatableItem& src) const noexcept
{
return !(operator==(src));
}
-void TranslatableItem::set_title_translation(const Glib::ustring& locale, const Glib::ustring& translation)
+void TranslatableItem::set_title_translation(const Glib::ustring& locale, const Glib::ustring& translation)
noexcept
{
if(translation.empty())
{
@@ -99,7 +99,7 @@ void TranslatableItem::set_title_translation(const Glib::ustring& locale, const
m_map_translations[locale] = translation;
}
-Glib::ustring TranslatableItem::get_title_translation(const Glib::ustring& locale, bool fallback) const
+Glib::ustring TranslatableItem::get_title_translation(const Glib::ustring& locale, bool fallback) const
noexcept
{
auto iterFind = m_map_translations.find(locale);
if(iterFind != m_map_translations.end())
@@ -142,18 +142,18 @@ Glib::ustring TranslatableItem::get_title_translation(const Glib::ustring& local
return Glib::ustring();
}
-const TranslatableItem::type_map_locale_to_translations& TranslatableItem::_get_translations_map() const
+const TranslatableItem::type_map_locale_to_translations& TranslatableItem::_get_translations_map() const
noexcept
{
return m_map_translations;
}
-bool TranslatableItem::get_has_translations() const
+bool TranslatableItem::get_has_translations() const noexcept
{
return !m_map_translations.empty();
}
-Glib::ustring TranslatableItem::get_title(const Glib::ustring& locale) const
+Glib::ustring TranslatableItem::get_title(const Glib::ustring& locale) const noexcept
{
if(!locale.empty())
{
@@ -166,12 +166,12 @@ Glib::ustring TranslatableItem::get_title(const Glib::ustring& locale) const
}
-Glib::ustring TranslatableItem::get_title_original() const
+Glib::ustring TranslatableItem::get_title_original() const noexcept
{
return m_title;
}
-void TranslatableItem::set_title(const Glib::ustring& title, const Glib::ustring& locale)
+void TranslatableItem::set_title(const Glib::ustring& title, const Glib::ustring& locale) noexcept
{
if(locale.empty())
{
@@ -182,13 +182,13 @@ void TranslatableItem::set_title(const Glib::ustring& title, const Glib::ustring
set_title_translation(locale, title);
}
-void TranslatableItem::set_title_original(const Glib::ustring& title)
+void TranslatableItem::set_title_original(const Glib::ustring& title) noexcept
{
m_title = title;
}
//TODO: Make this virtual and handle it in ChoiceValue?
-void TranslatableItem::clear_title_in_all_locales()
+void TranslatableItem::clear_title_in_all_locales() noexcept
{
m_title.clear();
@@ -199,12 +199,12 @@ void TranslatableItem::clear_title_in_all_locales()
}
}
-TranslatableItem::enumTranslatableItemType TranslatableItem::get_translatable_item_type() const
+TranslatableItem::enumTranslatableItemType TranslatableItem::get_translatable_item_type() const noexcept
{
return m_translatable_item_type;
}
-Glib::ustring TranslatableItem::get_translatable_type_name_nontranslated(enumTranslatableItemType item_type)
+Glib::ustring TranslatableItem::get_translatable_type_name_nontranslated(enumTranslatableItemType item_type)
noexcept
{
//TODO: Is there an easier way to do this, without duplicating code?
@@ -240,7 +240,7 @@ Glib::ustring TranslatableItem::get_translatable_type_name_nontranslated(enumTra
return "Unknown";
}
-Glib::ustring TranslatableItem::get_translatable_type_name(enumTranslatableItemType item_type)
+Glib::ustring TranslatableItem::get_translatable_type_name(enumTranslatableItemType item_type) noexcept
{
if(item_type == TRANSLATABLE_TYPE_FIELD)
return _("Field");
@@ -274,22 +274,22 @@ Glib::ustring TranslatableItem::get_translatable_type_name(enumTranslatableItemT
return _("Unknown");
}
-void TranslatableItem::set_name(const Glib::ustring& name)
+void TranslatableItem::set_name(const Glib::ustring& name) noexcept
{
m_name = name;
}
-Glib::ustring TranslatableItem::get_name() const
+Glib::ustring TranslatableItem::get_name() const noexcept
{
return m_name;
}
-bool TranslatableItem::get_name_not_empty() const
+bool TranslatableItem::get_name_not_empty() const noexcept
{
return !(get_name().empty());
}
-Glib::ustring TranslatableItem::get_title_or_name(const Glib::ustring& locale) const
+Glib::ustring TranslatableItem::get_title_or_name(const Glib::ustring& locale) const noexcept
{
const auto title = get_title(locale);
if(title.empty())
diff --git a/glom/libglom/data_structure/translatable_item.h b/glom/libglom/data_structure/translatable_item.h
index 490e50a..ce9609c 100644
--- a/glom/libglom/data_structure/translatable_item.h
+++ b/glom/libglom/data_structure/translatable_item.h
@@ -32,28 +32,28 @@ namespace Glom
class TranslatableItem
{
public:
- TranslatableItem();
- TranslatableItem(const TranslatableItem& src);
- TranslatableItem(TranslatableItem&& src);
+ TranslatableItem() noexcept;
+ TranslatableItem(const TranslatableItem& src) noexcept;
+ TranslatableItem(TranslatableItem&& src) noexcept;
virtual ~TranslatableItem();
- TranslatableItem& operator=(const TranslatableItem& src);
- TranslatableItem& operator=(TranslatableItem&& src);
+ TranslatableItem& operator=(const TranslatableItem& src) noexcept;
+ TranslatableItem& operator=(TranslatableItem&& src) noexcept;
- bool operator==(const TranslatableItem& src) const;
- bool operator!=(const TranslatableItem& src) const;
+ bool operator==(const TranslatableItem& src) const noexcept;
+ bool operator!=(const TranslatableItem& src) const noexcept;
/** Set the non-translated identifier name.
*/
- virtual void set_name(const Glib::ustring& name);
+ virtual void set_name(const Glib::ustring& name) noexcept;
/** Get the non-translated identifier name.
*/
- virtual Glib::ustring get_name() const;
+ virtual Glib::ustring get_name() const noexcept;
- bool get_name_not_empty() const; //For performance.
+ bool get_name_not_empty() const noexcept; //For performance.
- virtual Glib::ustring get_title_or_name(const Glib::ustring& locale) const;
+ virtual Glib::ustring get_title_or_name(const Glib::ustring& locale) const noexcept;
/** Get the title's translation for the specified locale, falling back to the
* original text if there is no translation.
@@ -64,39 +64,39 @@ public:
* @param locale The locale whose title text should be returned. If this is empty then the original text
will be returned.
* @result The text of the title.
*/
- virtual Glib::ustring get_title(const Glib::ustring& locale) const;
+ virtual Glib::ustring get_title(const Glib::ustring& locale) const noexcept;
//This is virtual so that ChoiceValue can override it.
/** Get the title's original (non-translated, usually English) text.
*/
- virtual Glib::ustring get_title_original() const;
+ virtual Glib::ustring get_title_original() const noexcept;
/** Get the title's translation for the specified @a locale, optionally
* falling back to a locale of the same language, and then falling back to
* the original.
* Calling this with the current locale is the same as calling get_title_original().
*/
- Glib::ustring get_title_translation(const Glib::ustring& locale, bool fallback = true) const;
+ Glib::ustring get_title_translation(const Glib::ustring& locale, bool fallback = true) const noexcept;
/** Set the title's translation for the specified locale.
* @param title The text of the title.
* @param locale The locale whose title text should be set. If this is empty then the original text will
be set.
*/
- void set_title(const Glib::ustring& title, const Glib::ustring& locale);
+ void set_title(const Glib::ustring& title, const Glib::ustring& locale) noexcept;
/** Set the title's original (non-translated, usually English) text.
* This is the same as calling set_title() with an empty locale parameter.
*/
- void set_title_original(const Glib::ustring& title);
+ void set_title_original(const Glib::ustring& title) noexcept;
/// Clear the original title and any translations of the title.
- void clear_title_in_all_locales();
+ void clear_title_in_all_locales() noexcept;
typedef std::map<Glib::ustring, Glib::ustring> type_map_locale_to_translations;
- bool get_has_translations() const;
+ bool get_has_translations() const noexcept;
enum enumTranslatableItemType
{
@@ -116,25 +116,25 @@ public:
TRANSLATABLE_TYPE_STATIC_TEXT
};
- enumTranslatableItemType get_translatable_item_type() const;
+ enumTranslatableItemType get_translatable_item_type() const noexcept;
//Direct access, for performance:
- const type_map_locale_to_translations& _get_translations_map() const;
+ const type_map_locale_to_translations& _get_translations_map() const noexcept;
- static Glib::ustring get_translatable_type_name(enumTranslatableItemType item_type);
+ static Glib::ustring get_translatable_type_name(enumTranslatableItemType item_type) noexcept;
/** The non-translated name is used for the context in gettext .po files.
*/
- static Glib::ustring get_translatable_type_name_nontranslated(enumTranslatableItemType item_type);
+ static Glib::ustring get_translatable_type_name_nontranslated(enumTranslatableItemType item_type) noexcept;
private:
/** Get the locale used as the source language.
* This is the language of the title that is used when there are no translations.
*/
- static Glib::ustring get_original_locale();
+ static Glib::ustring get_original_locale() noexcept;
- void set_title_translation(const Glib::ustring& locale, const Glib::ustring& translation);
+ void set_title_translation(const Glib::ustring& locale, const Glib::ustring& translation) noexcept;
protected:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]