pnoltes commented on code in PR #470: URL: https://github.com/apache/celix/pull/470#discussion_r1375760300
########## libs/utils/include/celix/Version.h: ########## @@ -0,0 +1,175 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#include <memory> +#include <string> + +#include "celix_version.h" + +namespace celix { + + /** + * @class Version + * @brief Class for storing and manipulating version information. + * + * The Version class represents a version number that follows the Semantic Versioning specification (SemVer). + * It consists of three non-negative integers for the major, minor, and micro version, and an optional string for + * the qualifier. + * The Version class provides comparison operators and functions for getting the individual version components. + * + * @note This class is a thin wrapper around the C API defined in celix_version.h. + */ + class Version { + public: + + ///@brief Constructs a new empty version with all components set to zero. + Version() : + cVersion{createVersion(celix_version_createEmptyVersion())}, + qualifier{celix_version_getQualifier(cVersion.get())} {} + + /** + * @brief Constructs a new version with the given components and qualifier. + * @param major The major component of the version. + * @param minor The minor component of the version. + * @param micro The micro component of the version. + * @param qualifier The qualifier string of the version. + */ +#if __cplusplus >= 201703L //C++17 or higher Review Comment: Remove C++17 string_view usage -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org