Base: Add isNullOrEmpty string helper

This adds isNullOrEmpty string helper that cheks if string is... well
null or empty. It is done to improve readability of the code and better
express intent.
This commit is contained in:
Kacper Donat
2025-02-20 17:47:06 +01:00
parent 928556c5e5
commit 12a69fe296
47 changed files with 113 additions and 72 deletions

View File

@@ -29,6 +29,7 @@
#include <Base/Stream.h>
#include <Base/Writer.h>
#include <Base/Uuid.h>
#include <Base/Tools.h>
#include "PropertyFile.h"
#include "Document.h"
@@ -110,7 +111,7 @@ std::string PropertyFileIncluded::getOriginalFileName() const
void PropertyFileIncluded::setValue(const char* sFile, const char* sName)
{
if (sFile && sFile[0] != '\0') {
if (!Base::Tools::isNullOrEmpty(sFile)) {
if (_cValue == sFile) {
throw Base::FileSystemError("Not possible to set the same file!");
}