Fix version number

This commit is contained in:
2025-07-01 10:39:48 +02:00
parent 4d6cad8f08
commit 81f2e706d0
2 changed files with 82 additions and 54 deletions

View File

@@ -63,7 +63,7 @@ struct ArffSummary {
* // Thread 2: globalArff.load("file2.arff"); // UNSAFE!
*/
class ArffFiles {
const std::string VERSION = "1.1.0";
const std::string VERSION = "1.2.0";
// Memory usage limits (configurable via environment variables)
static constexpr size_t DEFAULT_MAX_FILE_SIZE = 100 * 1024 * 1024; // 100 MB
@@ -256,7 +256,8 @@ public:
private:
// Helper function to validate file path for security
static void validateFilePath(const std::string& fileName) {
static void validateFilePath(const std::string& fileName)
{
if (fileName.empty()) {
throw std::invalid_argument("File path cannot be empty");
}
@@ -298,14 +299,16 @@ private:
throw std::invalid_argument("Path traversal detected after normalization: " + normalizedStr);
}
}
} catch (const std::filesystem::filesystem_error& e) {
}
catch (const std::filesystem::filesystem_error& e) {
// If filesystem operations fail, we can still proceed with basic validation
// This ensures compatibility with systems where filesystem might not be fully available
}
}
// Helper function to validate resource usage limits
static void validateResourceLimits(const std::string& fileName, size_t sampleCount = 0, size_t featureCount = 0) {
static void validateResourceLimits(const std::string& fileName, size_t sampleCount = 0, size_t featureCount = 0)
{
// Check file size limit
try {
if (std::filesystem::exists(fileName)) {
@@ -314,7 +317,8 @@ private:
throw std::invalid_argument("File size (" + std::to_string(fileSize) + " bytes) exceeds maximum allowed size (" + std::to_string(DEFAULT_MAX_FILE_SIZE) + " bytes)");
}
}
} catch (const std::filesystem::filesystem_error&) {
}
catch (const std::filesystem::filesystem_error&) {
// If filesystem operations fail, continue without size checking
// This ensures compatibility with systems where filesystem might not be available
}
@@ -626,7 +630,8 @@ private:
std::set<std::string>& uniqueClasses,
size_t& sampleCount,
int classIndex = -1,
const std::string& classNameToFind = "") {
const std::string& classNameToFind = "")
{
// Validate file path for security
validateFilePath(fileName);

View File

@@ -6,9 +6,7 @@ from conan.tools.files import copy
class ArffFilesConan(ConanFile):
name = "arff-files"
version = "X.X.X"
description = (
"Header-only library to read ARFF (Attribute-Relation File Format) files and return STL vectors with the data read."
)
description = "Header-only library to read ARFF (Attribute-Relation File Format) files and return STL vectors with the data read."
url = "https://github.com/rmontanana/ArffFiles"
license = "MIT"
homepage = "https://github.com/rmontanana/ArffFiles"
@@ -30,10 +28,35 @@ class ArffFilesConan(ConanFile):
def package(self):
# Copy header file to include directory
copy(self, "*.hpp", src=self.source_folder, dst=self.package_folder, keep_path=False)
copy(
self,
"*.hpp",
src=self.source_folder,
dst=self.package_folder,
keep_path=False,
)
# Copy license and readme for package documentation
copy(self, "LICENSE", src=self.source_folder, dst=self.package_folder, keep_path=False)
copy(self, "README.md", src=self.source_folder, dst=self.package_folder, keep_path=False)
copy(
self,
"LICENSE",
src=self.source_folder,
dst=self.package_folder,
keep_path=False,
)
copy(
self,
"README.md",
src=self.source_folder,
dst=self.package_folder,
keep_path=False,
)
copy(
self,
"CMakeLists.txt",
src=self.source_folder,
dst=self.package_folder,
keep_path=False,
)
def package_info(self):
# Header-only library configuration