LibCXX Class Collection
Release 0.25 of LibCXX
Installation, and requirements
I. Core classes
1. Throwing exceptions
Throwing customized exceptions
2. Reference-counted objects
Comparison with other implementations of reference-counted objects
Pointers and references
x::const_ref and x::const_ptr
create() - create reference-counted objects
Range-based iteration on reference-counted objects
Specifying a custom base
Multiple inheritance and casting
Restricting overload resolution
Creating an x::ref or an x::ptr from this
Second phase constructor
Using deduction guides with an x::ref or an x::ptr
Multiple inheritance with reference-counted objects
Private inheritance of reference-counted objects
Comparing x::refs and x::ptrs
Weak pointers
Reference and pointer traits
Constructing a collection of references
Destructor callbacks and mcguffins
A basic destructor callback
A destructor callback guard
Revocable destructor callbacks
Invoking a destructor callback when any of several objects gets destroyed
Waiting for a cascading destructor
Weak containers
Mcguffin containers
Circular strong references
3. Implementing iterators with reference-counted objects
Implementing a reference-counted object-based iterator
Accessing the underlying x::ref and x::ptr
Base class for reference-counted output iterators
Reference-counted output iterator tuples
4. Application properties
5. Application logging
6. File descriptor and stream objects
Other miscellaneous file-related function
Linux epoll() implementation
Linux eventfd() implementation
Linux timerfd() implementation
Linux Inotify implementation
The file descriptor transport superclass
Lightweight input and output file descriptor iterators
Automatic file descriptor timeouts
Automatic file descriptor terminator
Read limits
Using sockets
File attributes
Stream objects
String stream objects
File descriptor listeners and servers
POSIX shared memory segments, and memory-mapped files
7. Signals and signal file descriptors
Blocking signals
Signal file descriptors
Signal handlers
8. Filename pattern globbing
9. Perl-compatible regular expressions
10. Network interfaces
Network interface addresses
11. IO filter classes
12. iconv(3) IO filter
13. Reading directory contents
Reading the contents of a single directory
Reading the contents of a directory hierarchy
Miscellaneous functions
14. Singleton objects
15. Threads and related objects
Mutex-protected objects
Transferrable mutex locks
Mutex-protected references
Mutex objects
Condition variable objects
Shared lock objects
Execution threads
Checking the results of an execution thread
Arguments to run() methods must be copy-constructible
Optional superclasses of thread-executing objects
Running a lambda inside a separate thread
Cleanup thread
Stick a fork() in it: you're done
Thread logging
Timer threads
Using mcguffins to cancel recurring tasks
Weak local thread objects
Local thread singleton objects
Thread worker pools
A simple worker pool thread
Notifying an event file descriptor
Notifying an event queue
Thread-safe semaphore queue
A fixed semaphore
16. Forking other processes
Redirecting file descriptors
17. Locale objects
Message catalogs
Single and plural forms
18. Parsing command line options
Option parser generator
Specifying option types
Mutually exclusive options
Combining numeric options
Default option values
Option groups
Defining an option parsing subclass
Localizing option strings
Using gettextmsg() with localizable strings
GNU make macros
Using GNU make macros with automake
19. Event queues
20. Event factories
21. Very ImPortant object design pattern
Creating a very important object
Read and write locks
An update lock
A registration handler lock
Opportunistic locking
Optional template parameters
Avoiding deadlocks
Somewhat-ImPortant object design pattern
22. Derived values
23. Message dispatching-based thread design pattern
Sending messages to the thread
Starting the message-dispatching execution thread
The message queue
Using the message queue
Auxiliary message queues
Stopping the execution thread
Generic stoppable interface
Using a stylesheet to generate a thread-based message dispatching framework
XML definitions
Generating doxygen documentation
GNU make macros
Using GNU make macros with automake
24. A pool of locks that use event file descriptors
Lock pool starvation option
Shared lock pools
Mutually-exclusive lock pools
25. Object serialization
Use cases
Supported objects
Serializing an object
Serializing enumerated values
Serializing a beginning/ending iterator range
Calculating the size of the serialized object
Convenience functions for serializing a single object
Deserializing an object
Maximum sequence sizes
Deserializing any one of several objects
Convenience functions for deserializing a single object
Serializing classes
Serialization of object references
Deserialization traits class
Serializing file descriptors
26. Application singleton design pattern
Singleton startup and termination
Signals in singleton processes
Peer validation
Systemwide application singletons
Managed application singletons
Notes on thread concurrency with managed singletons
Example of a managed application singleton
Implementing a managed application singleton as a message dispatching-based thread
27. Date and time intervals
Loading timezone files
Local time
Generic interval parser
28. Format time using strftime
29. Unique identifiers
30. Base64 encoding and decoding
31. Quoted-printable encoding and decoding
32. User, group, and port lookups
33. URIs
Using international domain names
34. Headers
35. Hierarchical container template
Reader locks
Writer locks
Key iterators
Output of the example program
II. Miscellaneous classes and functions
36. Typesafe numerical aliases
Base classes
Testing for overflow
Using typesafe numerical aliases in unordered containers
37. Constructing visitors for std::variants
Checking if a type is visited by a variant
38. Sorting by indexes
39. Application identifiers and configuration directories
40. Virtual inheritance-based function callable objects
Virtual inheritance-based callables as reference-counted objects
Using callable objects to implement the callback design pattern
x::invoke_callbacks() helpers
Single execution thread callback container
Lambda weak pointer captures
41. Sentries
42. String conversions
Using x::value_string with custom classes
Convenience functions
43. A C++-ish strtok(); strsplit(), join(), and trim()
44. A joining iterator
45. Specialization for std::hash<void>
46. An ordered cache
47. A tokenizer helper template
48. Shell-like string split
49. The x::timespec class
50. Formatting memory or file sizes
51. A reference-counted vector class
52. Sorted and range vectors
Vectors of ranges
53. A postponed function call or an object call
Converting tuples to parameter packs
54. CSV-formatted data
55. Free disk space
56. Optional function arguments
Declaring an x::optional_args
Retrieving optional arguments
Optional arguments using reference wrappers
Using x::optional_arg_or
57. Loading shared libraries
III. httportmap
58. Registering an application
59. Connecting to applications
60. Other portmapper functionality
Advertising executable's pathname
IV. XML-related classes and functions
61. Parsing and creating XML documents
62. Accessing the contents of XML documents using reader locks
Navigating the XML document using a reader lock
Examining reader lock's current node
Using XPath expressions
63. Modifying XML documents using writer locks
Creator factories
Creating new XML elements and attributes
Creating other kinds of XML nodes, and other writer lock methods
Removing XML document nodes
An example of creating an XML document
64. XML document type definitions
Defining custom document type entities
65. Escaping XML strings
V. Writing and parsing YAML documents
66. Writing YAML documents
Writing x::yaml::newnodes
Writing a sequence
Writing a mapping
Writing a scalar value
Writing an alias reference
Example of writing a YAML document
67. Parsing YAML documents
Parsing scalars
Parsing sequences
Parsing mappings
Parsing aliases (not)
Example of parsing a YAML document
VI. GnuTLS classes
68. A wrapper for gnutls_datum_t
69. Private keys
70. Certificates
71. TLS sessions
Certificate credentials
Ephemeral and temporary parameters
Loading system-generated ephemeral parameters
Setting up a session
Convenience functions
TLS session caching, server side
TLS session caching, client side
Using the session
VII. Libgcrypt classes
72. Message digests/hashes
VIII. MIME classes and templates
73. Processing structured headers
74. Encoding MIME documents
Content transfer encoding
Constructing multipart MIME entities
Retrieving the encoded content
75. Parsing MIME documents
Delimiting MIME newline sequences
Parsing MIME documents that use CRLF newline sequences
Detecting start of a MIME document's body
Header parser iterator
MIME section information
MIME entity parser
Creating MIME entity parsers
Creating compound MIME entity parsers
Custom MIME section information classes
IX. HTTP clients and servers
76. A simple HTTP client example
Sending requests
Uploading files
Processing HTTP responses
Persistent HTTP connections
HTTP forms
Limiting form size
Encoding an HTTP form
HTTP authentication challenges
77. HTTP servers
Processing HTTP requests
Processing file uploads
Sending cookies to the client
Implementing basic authentication
Implementing digest authentication
Creating a x::http::serverauth
Invoking check_authentication()
Using both digest and basic authentication
Proxy authentication
Maximum request size limits
X. FTP client
78. Connecting to an FTP server
FTP over SSL
Traversing the server's contents
Downloading files
Uploading, renaming, and deleting files and directories
XI. Printing using the CUPS library
79. Available printing destinations
80. Printer information
81. Creating print jobs
XII. Extra LibCXX components
82. Installing the LibCXX SQL library
83. Installing the LibCXX X Windows Toolkit
A. Porting and compatibility notes
B. Manual Pages
httportmapd — Application portmapper
maillogs — Send log files by mail
properties — Set application property file