/* path.h
****************************************************************************************************************
****************************************************************************************************************

    Copyright (C) 2021 Askar Almatov

    This file is part of Trafficmeter.

    Trafficmeter is free software: you can redistribute it and/or modify it under the terms of the GNU General
    Public License as published by the Free Software Foundation, either version 3 of the License, or (at your
    option) any later version.

    Trafficmeter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
    implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
    License for more details.

    You should have received a copy of the GNU General Public License along with Trafficmeter. If not, see
    <http://www.gnu.org/licenses/>.
*/

#ifndef __PATH_H
#define __PATH_H 1

#include <cstdint>
#include <ctime>
#include <string>

namespace trafficmeter
{
    /**********************************************************************************************************/
    struct Path : public std::string
    {
        static const Path               base;

                                        Path( const std::string& path );
                                        Path( std::string&& path );
                                        Path( const char* path );
        Path&                           operator=( const std::string& path ); 
        Path&                           operator=( std::string&& path ); 
        Path&                           operator=( const char* path ); 
        Path                            subdir( int hash, int hashLength ) const;
        bool                            isExists() const;
        std::string                     fileName() const;
        uintmax_t                       fileSize() const;
        time_t                          mtime() const;
    };
}

#endif  // __PATH_H
