/******************************************************************************
** Copyright (c) 1992-2026 MAK Technologies, Inc
** All rights reserved.
******************************************************************************/


//! \file envNamedList.h
//! \ingroup mtl
//! \brief Contains the DtEnvNamedList class.

#ifndef envNamedList_H__
#define envNamedList_H__

#include "envList.h"

#ifdef DtUSE_UTILITIES_NAMESPACE
namespace DtUSE_UTILITIES_NAMESPACE
{
#endif


//! \brief A specialization of a list which assigns the first value as a name.
//! \ingroup mtl
class DT_DLL_MTL DtEnvNamedList : public DtEnvList 
{
public:
   friend class DtEnvironment;

   //! \brief DTOR
   virtual ~DtEnvNamedList();

   //! \brief Get the name of the list.
   virtual DtString name()  const;

   //! \brief Set the name of the list.
   virtual void setName(const DtString& name);

   //! \brief Get the first child in the list.
   virtual DtEnvValueSP first() const;

   //! \brief Check whether a value is a named list.
   static bool isNamedList(DtEnvValueSP);

   //! \brief Cast the value to a named list. 
   //! \return Returns a null pointer if the value is not a named list.
   static DtEnvNamedList* castToNamedList(DtEnvValueSP value);

protected:

   DtEnvNamedList(const DtString& name,const DtString& value);
   virtual DtEnvValue* clone() const;
};

#ifdef DtUSE_UTILITIES_NAMESPACE
}
#endif

#endif
