glibmm: glibmm Reference Manual

glibmm 2.57.1

glibmm Reference Manual

# Description

glibmm is the official C++ interface for the popular cross-platform library Glib. It provides non-UI API that is not available in standard C++ and makes it possible for gtkmm to wrap GObject-based APIs. See also the Programming with gtkmm book for a tutorial on programming with gtkmm and glibmm.

# Features

- Glib::ustring: A UTF-8 string class that can be used interchangably with std::string. Plus String Utility Functions
- Glib::RefPtr: A reference-counting smartpointer, for use with Glib::ObjectBase or similar
- Character Set Conversion
- Glib::Regex: Regular expression string matching.
- Glib::KeyFile: Parsing and writing of key files (similar to .ini files)
- Glib::Checksum
- Glib::Date, Glib::Timer, Glib::TimeVal
- Glib::Dispatcher: Inter-thread communication
- File Utilities and URI Utilities
- The Main Event Loop
- Spawning Processes
- Threads
- Miscellaneous Utility Functions

giomm (part of the glibmm project) also contains:

- Asynchronous IO. See Gio::File and the Stream Classes.
- Portable Network I/O Functionality
- D-Bus API
- Gio::Settings for application settings.

# Basic Usage

Include the glibmm header, plus giomm if necessary:

#include <glibmm.h>
#include <giomm.h>

(You may include individual headers, such as `glibmm/ustring.h` instead.)

If your source file is `program.cc`, you can compile it with:

g++ program.cc -o program `pkg-config --cflags --libs glibmm-2.58 giomm-2.58`

Alternatively, if using autoconf, use the following in `configure.ac:`

PKG_CHECK_MODULES([GLIBMM], [glibmm-2.58 giomm-2.58])

Then use the generated `GLIBMM_CFLAGS` and `GLIBMM_LIBS` variables in the project Makefile.am files. For example:

program_CPPFLAGS = $(GLIBMM_CFLAGS)
program_LDADD = $(GLIBMM_LIBS)