mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-05-07 06:59:44 +00:00
added new interface for working with human readably strings
This commit is contained in:
parent
2559e3d560
commit
2d2e1a9a5f
18
humanreadableobject.cpp
Normal file
18
humanreadableobject.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2022-2022 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
|
||||||
|
#include "humanreadableobject.h"
|
||||||
|
|
||||||
|
namespace QuasarAppUtils{
|
||||||
|
|
||||||
|
HumanReadableObject::HumanReadableObject()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
38
humanreadableobject.h
Normal file
38
humanreadableobject.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2022-2022 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#ifndef HUMANREADABLEOBJECT_H
|
||||||
|
#define HUMANREADABLEOBJECT_H
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
namespace QuasarAppUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The HumanReadableObject interface This is simple class that add one virtula method toString.
|
||||||
|
* All childs object should be override this method.
|
||||||
|
*/
|
||||||
|
class HumanReadableObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* @brief toString This method convert this object to human readable string.
|
||||||
|
* @return human readable string of this object.
|
||||||
|
*/
|
||||||
|
virtual QString toString() const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
HumanReadableObject();
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HRO This is short abriviature of the HumanReadableObject class.
|
||||||
|
*/
|
||||||
|
typedef HumanReadableObject HRO;
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif // HUMANREADABLEOBJECT_H
|
Loading…
x
Reference in New Issue
Block a user