Skip to content
Snippets Groups Projects
IOobjectI.H 4.51 KiB
Newer Older
  • Learn to ignore specific revisions
  • /*---------------------------------------------------------------------------*\
      =========                 |
      \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
       \\    /   O peration     |
    
    OpenFOAM bot's avatar
    OpenFOAM bot committed
        \\  /    A nd           | www.openfoam.com
    
         \\/     M anipulation  |
    
    OpenFOAM bot's avatar
    OpenFOAM bot committed
    -------------------------------------------------------------------------------
    
        Copyright (C) 2017-2021 OpenCFD Ltd.
    
    -------------------------------------------------------------------------------
    License
        This file is part of OpenFOAM.
    
    
        OpenFOAM 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.
    
    
        OpenFOAM 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 OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
    
    
    \*---------------------------------------------------------------------------*/
    
    
    // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
    
    template<class StringType>
    
    inline Foam::word Foam::IOobject::groupName
    (
        StringType base,
        const word& group
    )
    
        {
            return base;
        }
    
        return base + ('.' + group);
    }
    
    
    inline Foam::word Foam::IOobject::scopedName
    (
    
        return scope + (IOobject::scopeSeparator + name);
    
    // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
    
    // General access
    
    
    inline const Foam::word& Foam::IOobject::name() const noexcept
    
    inline Foam::word Foam::IOobject::group() const
    {
        return name_.ext();
    }
    
    
    inline Foam::word Foam::IOobject::member() const
    {
        return name_.lessExt();
    }
    
    
    
    inline const Foam::word& Foam::IOobject::headerClassName() const noexcept
    
    inline Foam::word& Foam::IOobject::headerClassName() noexcept
    
    inline const Foam::string& Foam::IOobject::note() const noexcept
    
    inline Foam::string& Foam::IOobject::note() noexcept
    
    inline bool Foam::IOobject::registerObject() const noexcept
    
    inline bool Foam::IOobject::registerObject(bool on) noexcept
    
        bool old(registerObject_);
        registerObject_ = on;
        return old;
    
    inline bool Foam::IOobject::globalObject() const noexcept
    
    inline bool Foam::IOobject::globalObject(bool on) noexcept
    
        bool old(globalObject_);
        globalObject_ = on;
        return old;
    
    inline unsigned Foam::IOobject::labelByteSize() const noexcept
    
        return static_cast<unsigned>(sizeofLabel_);
    
    inline unsigned Foam::IOobject::scalarByteSize() const noexcept
    
        return static_cast<unsigned>(sizeofScalar_);
    
    // Checks
    
    inline bool Foam::IOobject::isHeaderClassName(const word& clsName) const
    {
        return (clsName == headerClassName_);
    }
    
    
    template<class Type>
    inline bool Foam::IOobject::isHeaderClassName() const
    {
        return (Type::typeName == headerClassName_);
    }
    
    
    
    inline Foam::IOobject::readOption Foam::IOobject::readOpt() const noexcept
    
    inline Foam::IOobject::readOption
    Foam::IOobject::readOpt(readOption opt) noexcept
    
        readOption old(rOpt_);
        rOpt_ = opt;
        return old;
    
    inline Foam::IOobject::writeOption Foam::IOobject::writeOpt() const noexcept
    
    inline Foam::IOobject::writeOption
    Foam::IOobject::writeOpt(writeOption opt) noexcept
    
        writeOption old(wOpt_);
        wOpt_ = opt;
        return old;
    
    inline const Foam::fileName& Foam::IOobject::instance() const noexcept
    
    inline Foam::fileName& Foam::IOobject::instance() noexcept
    
    inline const Foam::fileName& Foam::IOobject::local() const noexcept
    
    {
        return local_;
    }
    
    
    inline Foam::fileName Foam::IOobject::objectPath() const
    {
        return path()/name();
    }
    
    
    // Error Handling
    
    
    inline bool Foam::IOobject::good() const noexcept
    
    inline bool Foam::IOobject::bad() const noexcept
    
    
    // ************************************************************************* //