|
1 | | -// This example demonstrates how to use the ARIO library to read and manipulate UNIX archive files. |
| 1 | +/* |
| 2 | +Copyright (C) 2025-present by Serge Lamikhov-Center |
| 3 | +
|
| 4 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 5 | +of this software and associated documentation files (the "Software"), to deal |
| 6 | +in the Software without restriction, including without limitation the rights |
| 7 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 8 | +copies of the Software, and to permit persons to whom the Software is |
| 9 | +furnished to do so, subject to the following conditions: |
| 10 | +
|
| 11 | +The above copyright notice and this permission notice shall be included in |
| 12 | +all copies or substantial portions of the Software. |
| 13 | +
|
| 14 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 19 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 20 | +THE SOFTWARE. |
| 21 | +*/ |
| 22 | + |
| 23 | +//------------------------------------------------------------------------------ |
| 24 | +// arioso.cpp |
| 25 | +// |
| 26 | +// This example demonstrates how to use the ARIO library (with optional ELFIO integration) |
| 27 | +// to manage UNIX archive (.ar) files from the command line. It provides a practical tool |
| 28 | +// for extracting, deleting, and adding files to an archive, similar to the standard 'ar' utility. |
| 29 | +// |
| 30 | +// Purpose: |
| 31 | +// - Showcase ARIO’s API for reading, modifying, and writing UNIX archive files. |
| 32 | +// - Illustrate integration with ELFIO for symbol extraction from ELF object files. |
| 33 | +// |
| 34 | +// Abilities: |
| 35 | +// - Extraction: Extracts specified files from the archive to the current directory. |
| 36 | +// - Deletion: Removes specified files from the archive. |
| 37 | +// - Addition: Adds new files to the archive, collecting and storing global symbols if the file is an ELF object. |
| 38 | +// - Archive update: Safely writes changes to the archive using a temporary file for atomic updates. |
| 39 | +// - Command-line interface: Accepts commands in the form: |
| 40 | +// arioso <archive> [-e <files...>] [-d <files...>] [-a <files...>] |
| 41 | +// |
| 42 | +// This example serves as both a reference for ARIO/ELFIO usage and a foundation for building custom archive management tools. |
| 43 | +// |
2 | 44 |
|
3 | 45 | #include <iostream> |
4 | 46 | #include <vector> |
|
0 commit comments