slice2cpp(1)

πŸ“¦
version 3.7.10 Β· 3 versions
, in arch rolling, debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute

πŸ’… slice2cpp β€” the Slice-to-C++ compiler, bestie edition

okay so real quick, this is the manual page for slice2cpp(1), which lives in the General Commands Manual section. It's the compiler that takes your Slice files and turns them into C++, and it's lowkey iconic. Let's get into it. πŸ¦‹


✨ NAME ✨

slice2cpp β€” the Slice to C++ compiler. that's it, that's the name. short, sweet, slays. πŸ‘‘


🌸 SYNOPSIS 🌸

slice2cpp [options] [files]

like. you give it options. you give it files. it does the thing. periodt. πŸ’–


πŸŽ€ DESCRIPTION πŸŽ€

So slice2cpp compiles Slice files to C++. That's the whole job, and it does it gorgeously. πŸ’…

Also, during this compilation, the macro __SLICE2CPP__ is defined. so if your Slice code needs to know "hey am I being compiled by slice2cpp rn", it can just vibe check that macro. iykyk. ✨

The full documentation for slice2cpp is available online at:

https://doc.zeroc.com/ice/latest/language-mappings/c++11-mapping/slice2cpp-command-line-options

go read it, it's giving thorough. 🫢


πŸ”₯ OPTIONS πŸ”₯

okay bestie this is the part where you actually pay attention, because every single one of these matters. no skipping. πŸ™ˆ

  • -h, --help β€” displays the help message. classic. when in doubt, ask for help, that's self-care. πŸ’–
  • -v, --version β€” displays the compiler version. so you know exactly which queen you're working with. πŸ‘‘
  • -DNAME β€” defines the preprocessor symbol NAME. manifesting a symbol into existence. ✨
  • -DNAME=DEF β€” defines the preprocessor symbol NAME with the value DEF. same energy, but now with a value attached. πŸ’…
  • -UNAME β€” undefines the preprocessor symbol NAME. we are un-manifesting. it's gone. not me deleting symbols 😭
  • -IDIR β€” add the directory DIR to the search path for #include directives. so your includes can actually find their friends. 🫢
  • -E β€” print the preprocessor output on stdout. just the preprocessor output, out loud, on your screen. 🌈
  • --output-dir DIR β€” place the generated files into directory DIR. your files, your folder, your rules. πŸŽ€
  • -d, --debug β€” print debug information showing the operation of the Slice parser. it's giving "let me narrate my whole process". πŸ¦‹
  • --depend β€” print dependency information to standard output by default, or to the file specified by the --depend-file option. No code is generated when this option is specified. so like, dependencies only, no code, we're just here for the lore. πŸ’€
  • --depend-xml β€” print dependency information in XML format to standard output by default, or to the file specified by the --depend-file option. No code is generated when this option is specified. same as above but make it XML, make it fancy. ✨
  • --depend-file FILE β€” directs dependency information to the specified file. The output format depends on whether --depend or --depend-xml is also specified. so this one is the destination, and the other two decide the vibe of what lands there. πŸ“
  • --validate β€” checks the provided command-line options for correctness, and does not generate any code. it's the vibe check option. nothing gets generated, everything gets judged. βœ…
  • --header-ext EXT β€” changes the file extension for the generated header files from the default h to EXT. glow-up for your file extensions. πŸ’…
  • --source-ext EXT β€” changes the file extension for the generated source files from the default cpp to EXT. same glow-up, source file edition. 🌸
  • --add-header HDR[,GUARD] β€” this option adds an include directive for the specified header at the beginning of the generated source file (preceding any other include directives). If GUARD is specified, the include directive is protected by the specified guard. so HDR goes first, first first, before literally everything else, and GUARD is the optional bodyguard. πŸ›‘οΈ
  • --include-dir DIR β€” modifies #include directives in source files to prepend the path name of each header file with the directory DIR. putting DIR in front of every header path like a little prefix accessory. πŸŽ€
  • --impl-c++11 β€” generate sample implementation files for the C++11 mapping. This option will not overwrite an existing file. so like, it's polite, it will not touch what's already there. 🫢
  • --impl-c++98 β€” generate sample implementation files for the C++98 mapping. This option will not overwrite an existing file. same polite energy, different mapping. πŸ’œ
  • --checksum β€” generate checksums for Slice definitions. for when you need receipts. 🧾

🌈 SEE ALSO 🌈

your other favs, the whole compiler friend group:


and that's the whole page, bestie!! this was slice2cpp(1) from the General Commands Manual, and that's the official slice2cpp(1) footer energy right there. go compile something gorgeous. no cap. πŸ’–βœ¨πŸŽ€πŸ¦‹