/*
 * htwg_string.h
 *
 * Stark vereinfachte String-Klasse.
 *
 * Autor: H.Drachenfels
 * Erstellt am: 30.5.2024
 */
#ifndef HTWG_STRING_H
#define HTWG_STRING_H

#include <cstddef> // size_t

namespace htwg
{
    class string final
    {
    private:
        std::size_t n;
        char *s;

    public:
        string();
        string(const char*); // bewusst nicht explicit

        // Rule-of-five-Memberfunktionen (Destruktor und Copy/Move)
        ~string();
        string(const string&);
        string(string&&);
        string& operator=(const string&);
        string& operator=(string&&);

        // String-Konkatenation
        string& operator+=(const string&);

        // Vergleich(e)
        friend bool operator<(const string&, const string&);

        // Datenabfragen
        const char* c_str() const;
        std::size_t length() const;
    };
}

#endif

