/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #include "MGCLStdAfx.h" #include "mg/Ofstream.h" #include "mg/Ifstream.h" #include "mgGL/Name.h" #if defined(_DEBUG) #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif MGName::MGName():MGGLAttrib(UNDEFINED){;}; MGName::MGName(const std::string& name):MGGLAttrib(1), m_name(name){;} MGName* MGName::clone()const{ return new MGName(*this); } void MGName::setName(std::string& name){ m_flag=1; m_name=name; } void MGName::setName(char* name){ m_flag=1; m_name=name; } // Output function. std::ostream& MGName::out(std::ostream& ostrm) const{ ostrm<<"Name="; MGGLAttrib::out(ostrm); if(enabled()){ ostrm<<"="<>nchar; char* c=new char[nchar+1]; buf.readnChar(c,nchar); c[nchar]=0; m_name=std::string(c); delete[] c; }