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.
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/libcvault
cd libcvault
g++ -std=c++17 -c main.cpp -o libcvault.o
g++ -std=c++17 my_app.cpp libcvault.o -o 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: 38- Author: tecnolgd
- License: MIT License