LibCXX


Index

LibCXX Class Collection
Introduction
Release 0.13 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
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
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
isa()
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
Introduction
Mutex-protected objects
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
gettextmsg()
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
Encoding
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
Locks
Reader locks
Writer locks
Shortcuts
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
38. Sorting by indexes
39. Application-specific 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. An ordered cache
46. A tokenizer helper template
47. Shell-like string split
48. The x::timespec class
49. Formatting memory or file sizes
50. A reference-counted vector class
51. Sorted vectors
Modifiers
52. A postponed function call or an object call
Converting tuples to parameter packs
53. CSV-formatted data
54. Free disk space
55. Loading shared libraries
III. httportmap
56. Registering an application
57. Connecting to applications
58. Other portmapper functionality
Advertising executable's pathname
IV. XML-related classes and functions
59. Parsing and creating XML documents
60. 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
61. 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
62. XML document type definitions
Defining custom document type entities
63. Escaping XML strings
V. Writing and parsing YAML documents
64. Writing YAML documents
x::yaml::newdocumentnodes
Writing x::yaml::newnodes
Writing a sequence
Writing a mapping
Writing a scalar value
Writing an alias reference
Example of writing a YAML document
65. Parsing YAML documents
Parsing scalars
Parsing sequences
Parsing mappings
Parsing aliases (not)
Example of parsing a YAML document
VI. GnuTLS classes
66. A wrapper for gnutls_datum_t
67. Private keys
68. Certificates
69. 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
70. Message digests/hashes
VIII. MIME classes and templates
71. Processing structured headers
72. Encoding MIME documents
Content transfer encoding
Constructing multipart MIME entities
Retrieving the encoded content
73. Parsing MIME documents
Delimiting MIME newline sequences
Parsing MIME documents that use CRLF newline sequences
Summary
Detecting start of a MIME document's body
Header parser iterator
x::mime::header_collector
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
74. A simple HTTP client example
Sending requests
Uploading files
Processing HTTP responses
Persistent HTTP connections
Cookies
HTTP forms
Limiting form size
Encoding an HTTP form
HTTP authentication challenges
75. 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
76. 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
77. Available printing destinations
78. Printer information
79. Creating print jobs
XII. Extra LibCXX components
80. Installing the LibCXX SQL library
81. 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
C. COPYING