libglom-1.32: Glom::Utils Namespace Reference

libglom-1.32 1.31.4

- Main Page
- Namespaces
- Classes

- Namespace List
- Namespace Members

Typedefs | Functions
Glom::Utils Namespace Reference

## Typedefs
typedef std::vector< std::shared_ptr< const LayoutItem_Field > > | type_vecConstLayoutFields
typedef std::vector< std::shared_ptr< Field > > | type_vec_fields

## Functions
template<typename T_container , typename T_element >
bool | find_exists (const T_container& container, const T_element& element)
template<typename T_container , typename T_callable >
bool | find_if_exists (const T_container& container, const T_callable& callable)
template<typename T_container , typename T_element >
T_container::iterator | find (T_container& container, const T_element& element)
template<typename T_container , typename T_element >
T_container::const_iterator | find (const T_container& container, const T_element& element)
template<typename T_container , typename T_callable >
T_container::iterator | find_if (T_container& container, const T_callable& callable)
template<typename T_container , typename T_callable >
T_container::const_iterator | find_if (const T_container& container, const T_callable& callable)
template<typename T_container , typename T_element >
void | add_unique (T_container& container, T_element&& element)
template<typename T_container_input , typename T_container_output >
void | copy (T_container_input input, T_container_output& output)
template<typename T_element >
decltype(auto) | const_list (const std::vector< std::shared_ptr< T_element >>& input)
Glib::ustring | locale_simplify (const Glib::ustring& locale_id)
| Get just the first part of a locale, such as de_DE, ignoring, for instance, .UTF-8 or @euro at the end. More...
Glib::ustring | locale_language_id (const Glib::ustring& locale_id)
| Get just the language ID part of a locale, such as de from "de_DE",. More...
bool | script_check_for_pygtk2 (const Glib::ustring& script)
bool | get_resource_exists (const std::string& resource_path)
| This is simpler than catching the exception from Gio::Resource::get_info_global(). More...
template<typename E >
constexpr std::underlying_type< E >::type | to_utype (E enumerator) noexcept
Glib::ustring | get_list_of_layout_items_for_display (const LayoutGroup::type_list_items& list_layout_fields)
| Get a string to display to the user, as a representation of a list of layout items. More...
Glib::ustring | get_list_of_layout_items_for_display (const std::shared_ptr< const LayoutGroup >& layout_group)
| Get a string to display to the user, as a representation of a list of layout items. More...
Glib::ustring | get_list_of_sort_fields_for_display (const Formatting::type_list_sort_fields& sort_fields)
| Get a string to display to the user, as a representation of a sort order. More...
LayoutGroup::type_list_const_items | get_layout_items_plus_primary_key (const LayoutGroup::type_list_const_items& items, const std::shared_ptr< const Document >& document, const Glib::ustring& table_name)
| This returns the provided list of layout items, plus the primary key, if the primary key is not already present in the list. More...
LayoutGroup::type_list_items | get_layout_items_plus_primary_key (const LayoutGroup::type_list_items& items, const std::shared_ptr< const Document >& document, const Glib::ustring& table_name)
| This returns the provided list of layout items, plus the primary key, if the primary key is not already present in the list. More...
type_vecConstLayoutFields | get_table_fields_to_show_for_sequence (const std::shared_ptr< const Document >& document, const Glib::ustring& table_name, const Document::type_list_const_layout_groups& mapGroupSequence)
template<typename T_Container >
bool | find_if_layout_item_field_is_same_field_exists (T_Container& container, const std::shared_ptr< const LayoutItem_Field >& layout_item)
| Find the element in the container which is a LayoutItem_Field which refers to the same field, without comparing irrelevant stuff such as formatting. More...

## Typedef Documentation

typedef std::vector< std::shared_ptr<Field> > Glom::Utils::type_vec_fields

typedef std::vector< std::shared_ptr<const LayoutItem_Field> > Glom::Utils::type_vecConstLayoutFields

## Function Documentation

template <typename T_container , typename T_element >

void Glom::Utils::add_unique | ( | T_container & | container,
|  | T_element && | element
| ) |  |

template <typename T_element >

decltype(auto) Glom::Utils::const_list | ( | const std::vector< std::shared_ptr< T_element >> & | input | ) |

template <typename T_container_input , typename T_container_output >

void Glom::Utils::copy | ( | T_container_input | input,
|  | T_container_output & | output
| ) |  |

template <typename T_container , typename T_element >

T_container::iterator Glom::Utils::find | ( | T_container & | container,
|  | const T_element & | element
| ) |  |

template <typename T_container , typename T_element >

T_container::const_iterator Glom::Utils::find | ( | const T_container & | container,
|  | const T_element & | element
| ) |  |

template <typename T_container , typename T_element >

bool Glom::Utils::find_exists | ( | const T_container & | container,
|  | const T_element & | element
| ) |  |

template <typename T_container , typename T_callable >

T_container::iterator Glom::Utils::find_if | ( | T_container & | container,
|  | const T_callable & | callable
| ) |  |

template <typename T_container , typename T_callable >

T_container::const_iterator Glom::Utils::find_if | ( | const T_container & | container,
|  | const T_callable & | callable
| ) |  |

template <typename T_container , typename T_callable >

bool Glom::Utils::find_if_exists | ( | const T_container & | container,
|  | const T_callable & | callable
| ) |  |

template <typename T_Container >

bool Glom::Utils::find_if_layout_item_field_is_same_field_exists | ( | T_Container & | container,
|  | const std::shared_ptr< const LayoutItem_Field >& | layout_item
| ) |  |

Find the element in the container which is a LayoutItem_Field which refers to the same field, without comparing irrelevant stuff such as formatting.

This assumes that the element is a shared_ptr<>.

LayoutGroup::type_list_const_items Glom::Utils::get_layout_items_plus_primary_key | ( | const LayoutGroup::type_list_const_items& | items,
|  | const std::shared_ptr< const Document >& | document,
|  | const Glib::ustring & | table_name
| ) |  |

This returns the provided list of layout items, plus the primary key, if the primary key is not already present in the list.

LayoutGroup::type_list_items Glom::Utils::get_layout_items_plus_primary_key | ( | const LayoutGroup::type_list_items& | items,
|  | const std::shared_ptr< const Document >& | document,
|  | const Glib::ustring & | table_name
| ) |  |

This returns the provided list of layout items, plus the primary key, if the primary key is not already present in the list.

Glib::ustring Glom::Utils::get_list_of_layout_items_for_display | ( | const LayoutGroup::type_list_items& | list_layout_fields | ) |

Get a string to display to the user, as a representation of a list of layout items.

Glib::ustring Glom::Utils::get_list_of_layout_items_for_display | ( | const std::shared_ptr< const LayoutGroup >& | layout_group | ) |

Get a string to display to the user, as a representation of a list of layout items.

Glib::ustring Glom::Utils::get_list_of_sort_fields_for_display | ( | const Formatting::type_list_sort_fields& | sort_fields | ) |

Get a string to display to the user, as a representation of a sort order.

bool Glom::Utils::get_resource_exists | ( | const std::string & | resource_path | ) |

This is simpler than catching the exception from Gio::Resource::get_info_global().

Returns
  true if the GResource exists.

type_vecConstLayoutFields Glom::Utils::get_table_fields_to_show_for_sequence | ( | const std::shared_ptr< const Document >& | document,
|  | const Glib::ustring & | table_name,
|  | const Document::type_list_const_layout_groups& | mapGroupSequence
| ) |  |

Glib::ustring Glom::Utils::locale_language_id | ( | const Glib::ustring & | locale_id | ) |

Get just the language ID part of a locale, such as de from "de_DE",.

Glib::ustring Glom::Utils::locale_simplify | ( | const Glib::ustring & | locale_id | ) |

Get just the first part of a locale, such as de_DE, ignoring, for instance, .UTF-8 or @euro at the end.

bool Glom::Utils::script_check_for_pygtk2 | ( | const Glib::ustring & | script | ) |

Returns
  true if the script is OK, or false if the script uses pygtk2, which would cause a crash, because Glom itself uses GTK+ 3.

template <typename E >

constexpr std::underlying_type<E>::type Glom::Utils::to_utype | ( | E | enumerator | ) |
| noexcept