home *** CD-ROM | disk | FTP | other *** search
- #include <classes/DOS/dos.h>
-
- #include <exec/memory.h>
-
- #pragma -
- #include <pragma/dos_lib.h>
- #include <pragma/exec_lib.h>
- #pragma +
-
- DosObjectC::DosObjectC(ULONG type, struct TagItem *tags)
- : ShareC(),
- priv(TRUE)
- {
- dostype = type;
- dosobject = AllocDosObject(type,tags);
- if (!dosobject)
- throw DosObjectX(type);
- }
-
- DosObjectC::DosObjectC(ULONG type, Tag tag1type, ...)
- : ShareC(),
- priv(TRUE)
- {
- dostype = type;
- dosobject = AllocDosObject(type,(struct TagItem *) &tag1type);
- if (!dosobject)
- throw DosObjectX(type);
- }
-
- DosObjectC::DosObjectC(ULONG type, APTR object)
- : ShareC(),
- priv(FALSE)
- {
- dostype = type;
- dosobject = object;
- if (!dosobject)
- throw DosObjectX(type);
- }
-
- DosObjectC::DosObjectC(const DosObjectC &s)
- : ShareC(s)
- {
- dostype = s.dostype;
- dosobject = s.dosobject;
- priv = s.priv;
- }
-
- DosObjectC::~DosObjectC()
- {
- if (only())
- {
- if (priv)
- FreeDosObject(dostype,dosobject);
- };
- }
-
- DosObjectC &DosObjectC::operator= (const DosObjectC &s)
- {
- if (this != &s)
- {
- if (only())
- {
- if (priv)
- FreeDosObject(dostype,dosobject);
- };
- ShareC::operator=(s);
- dostype = s.dostype;
- dosobject = s.dosobject;
- priv = s.priv;
- };
- return *this;
- }
-
- // *************************************************************
-
-