libcvault is a C++ library for static file metadata analysis. It is intended to provide reusable functions for another C++ program(as of now) rather than operate as a standalone executable.
Warning
libcvault is currently undergoing active refactor and API updates. Please make sure to use the v2.1.0-beta version for required applications.
populateData()— scan a directory and load regular file metadatagetTotalBytes()— compute the total byte size of loaded filesgetFileCount()— return the number of loaded filessortFileOnByte()— sort files by sizemaxFile()- return the largest file sizesortFileOnName()— sort files by namesearchFile()- search by filenamelineCount()— count lines in a text filegetFileName()- returns the name of the file present at a given indexgetFileSize()- returns the size(bytes) of the file present at a given indexgetFiles()- returns a raw pointer to the internal memory buffer of the file list
- C++17-compatible compiler
- Standard library support for
<filesystem>
git clone https://github.com/tecnolgd/libcvaultcd libcvault-
Manual Build
- Create the object file(
libcvault.o)g++ -std=c++17 -c main.cpp -o libcvault.o
- Link with the source code(
my_app.cpp)g++ -std=c++17 my_app.cpp libcvault.o -o my_app
- Create the object file(
After building, run the application
./my_app#include "head.hpp"
#include <iostream>
int main() {
if (populateData(".") != 0) {
std::cerr << "Directory scan failed\n";
return 1;
}
std::cout << "Files found: " << getFileCount() << "\n";
std::cout << "Total bytes: " << getTotalBytes() << "\n";
std::cout << "Lines in head.hpp: " << lineCount("head.hpp") << "\n";
return 0;
}Files found: 233
Total bytes: 585441
Lines in head.hpp: 38If libcvault has positively impacted your workflow, consider:
- Starring this repository
- Forking the project
- Sharing feedback and suggestions
- Contributing to the codebase
MIT