Packages
Rix packages are optional userland libraries for Vix.cpp applications.
They are not part of the Vix.cpp core runtime.
They are installed through the Vix Registry and used from normal C++ code.
The recommended public entry point is the unified Rix facade:
#include <rix.hpp>Then use package APIs through:
rix.auth
rix.csv
rix.debug
rix.pdfPackage model
Every Rix package follows the same model:
Package : rix/name
Header : <rix/name.hpp>
Namespace: rixlib::name
Facade : rix.nameExample:
Package : rix/auth
Header : <rix/auth.hpp>
Namespace: rixlib::auth
Facade : rix.authThe unified facade package is:
Package: rix/rix
Header : <rix.hpp>
Object : rixInstall the facade package
For most applications, install the unified facade:
vix add rix/rix
vix installIf the project uses vix.app, declare the dependency in deps:
deps = [
"rix/rix",
]deps is for packages from the Vix Registry.
Do not put Rix packages in packages.
Install an independent package
You can also install one package directly.
Example with Auth only:
vix add rix/auth
vix installThen declare it in vix.app:
deps = [
"rix/auth",
]Independent packages are useful when a project or library only needs one package and does not want the full facade package.
For public documentation examples, the recommended path remains:
#include <rix.hpp>and:
rix.<package>Current packages
Rix currently includes these userland packages:
| Package | Facade API | Purpose |
|---|---|---|
rix/auth | rix.auth | Authentication helpers for users, passwords, sessions, and tokens. |
rix/csv | rix.csv | CSV parsing, writing, file loading, file saving, and table helpers. |
rix/debug | rix.debug | Lightweight debug printing, formatting, string rendering, and inspection. |
rix/pdf | rix.pdf | PDF document creation, text, tables, drawing, metadata, images, and saving. |
Auth
rix/auth provides authentication helpers for Vix.cpp applications.
Use it for:
- user registration
- login
- password hashing
- session authentication
- session refresh
- logout
- logout all sessions for a user
- token issuing
- explicit error handling
- memory-backed stores
- database-backed stores
Facade example:
#include <rix.hpp>
int main()
{
auto auth = rix.auth.memory();
auto registered = auth.register_user({"ada@example.com", "correct-password"});
if (registered.failed())
{
return 1;
}
auto login = auth.login({"ada@example.com", "correct-password"});
return login.failed() ? 1 : 0;
}Continue with:
CSV
rix/csv provides CSV utilities for C++ applications.
Use it for:
- parsing CSV strings
- parsing CSV streams
- writing CSV strings
- writing rows
- loading CSV files
- saving CSV files
- read options
- write options
- dictionary-style rows
- streaming parsing
- table helpers
Facade example:
#include <rix.hpp>
int main()
{
auto table = rix.csv.parse(
"name,language\n"
"Ada,C++\n"
"Gaspard,Vix.cpp\n"
);
auto output = rix.csv.write(table);
return output.empty() ? 1 : 0;
}CSV documentation will cover parsing, writing, options, helpers, and API reference.
Debug
rix/debug provides lightweight debug utilities.
Use it for:
- simple printing
- error printing
- debug-only printing
- rendering printed values into strings
- placeholder-based formatting
- value inspection
Facade example:
#include <rix.hpp>
int main()
{
rix.debug.print("Hello", "Rix");
auto text = rix.debug.format("Package: {}", "rix/debug");
rix.debug.inspect(text);
return 0;
}Use rix.debug for lightweight debug output and inspection.
For application logging, prefer the Vix logging system.
Debug documentation will cover print, format, inspect, and API reference.
PDF
rix/pdf provides PDF generation utilities.
Use it for:
- creating documents
- adding pages
- drawing text
- drawing headings
- drawing paragraphs
- drawing lines and shapes
- creating tables
- setting metadata
- embedding JPEG images
- writing PDF bytes
- saving PDF files
- simple text PDF generation
- explicit error handling
Facade example:
#include <rix.hpp>
int main()
{
auto doc = rix.pdf.document();
auto &page = doc.add_page();
page.text(
page.x_left(),
page.y_top(),
"Hello from rix.pdf"
);
auto saved = rix.pdf.save(doc, "hello.pdf");
return saved.failed() ? 1 : 0;
}PDF documentation will cover documents, text, tables, drawing, metadata, save/write, errors, and API reference.
Facade vs independent packages
Use the facade when you want one clean public API:
#include <rix.hpp>
auto auth = rix.auth.memory();
auto table = rix.csv.parse("name,lang\nAda,C++\n");
auto doc = rix.pdf.document();Use an independent package when you only need one package:
#include <rix/auth.hpp>The facade is best for applications.
Independent packages are useful for smaller dependency surfaces, reusable libraries, and advanced package-level usage.
Packages and vix.app
Registry packages belong in deps.
Facade dependency:
deps = [
"rix/rix",
]Independent package dependencies:
deps = [
"rix/auth",
"rix/csv",
"rix/debug",
"rix/pdf",
]Do not put Rix packages here:
packages = [
"rix/rix",
]packages is for CMake find_package.
deps is for Vix Registry packages.
Single-file usage
For quick experiments, a package can be used from a single file.
Example:
mkdir -p ~/rix-package-example
cd ~/rix-package-example
touch main.cpp#include <rix.hpp>
int main()
{
rix.debug.print("Rix packages are available");
return 0;
}Run:
vix run main.cppIf the facade package is not available yet, install it globally:
vix install -g rix/rixThen run again:
vix run main.cppFor real applications, prefer local project dependencies:
vix add rix/rix
vix installWhat you should remember
Rix packages are optional userland libraries for Vix.cpp applications.
Use the facade for public application code:
#include <rix.hpp>Then use:
rix.auth
rix.csv
rix.debug
rix.pdfDeclare Registry packages in vix.app using:
deps = [
"rix/rix",
]Use independent packages when you want a smaller direct dependency.
Next step
Start with Auth.
Next: Auth Overview