Exemplo n.º 1
0
void 
dimeClass::setApplicationName(const char * const appname, 
			     dimeMemHandler * const memhandler)
{
  if (!memhandler) delete this->appName;
  DXF_STRCPY(memhandler, this->appName, appname);
}
Exemplo n.º 2
0
bool
dimeStringRecord::setString(const char * const s, 
			   dimeMemHandler * const memhandler)
{
  DXF_STRCPY(memhandler, this->string, s);
  return this->string != NULL;
}
Exemplo n.º 3
0
void 
dimeClass::setClassName(const char * const classname, 
		       dimeMemHandler * const memhandler)
{
  if (!memhandler) delete this->className;
  DXF_STRCPY(memhandler, this->className, classname);
}
Exemplo n.º 4
0
/*!
  Sets the layer name.
*/
void 
dimeLayerTable::setLayerName(const char * name, dimeMemHandler * const memhandler)
{
  if (this->layerName && memhandler == NULL) {
    delete this->layerName;
  }
  DXF_STRCPY(memhandler, this->layerName, name);
}
Exemplo n.º 5
0
bool
dimeClass::copyRecords(dimeClass * const myclass, dimeModel * const model) const
{
  dimeMemHandler *memh = model->getMemHandler();
  bool ok = dimeRecordHolder::copyRecords(myclass, memh);
  
  if (ok && this->className) {
    DXF_STRCPY(memh, myclass->className, this->className);
    ok = myclass->className != NULL;
  }
  if (ok && this->appName) {
    DXF_STRCPY(memh, myclass->appName, this->appName);
    ok = myclass->className != NULL;
  }
  if (ok) {
    myclass->versionNumber = this->versionNumber;
    myclass->flag1 = this->flag1;
    myclass->flag2 = this->flag2;
  }
  return ok;
}
Exemplo n.º 6
0
bool 
dimeClass::handleRecord(const int groupcode,
			const dimeParam &param,
			dimeMemHandler * const memhandler)
{
  switch (groupcode) {
  case 1:
    DXF_STRCPY(memhandler, this->className, param.string_data);
    return true;
  case 2:
    DXF_STRCPY(memhandler, this->appName, param.string_data);
    return true;
  case 90:
    this->versionNumber = param.int32_data;
    return true;
  case 280:
    this->flag1 = param.int8_data;
    return true;
  case 281:
    this->flag2 = param.int8_data;
    return true;
  }
  return false;
}
Exemplo n.º 7
0
dimeTableEntry *
dimeLayerTable::copy(dimeModel * const model) const
{
  dimeMemHandler *memh = model->getMemHandler();
  dimeLayerTable *l = new(memh) dimeLayerTable;
  l->colorNumber = this->colorNumber;
  if (this->layerName) {
    DXF_STRCPY(memh, l->layerName, this->layerName);
  }
  if (this->layerInfo) {
    l->layerInfo = (dimeLayer*)model->addLayer(this->layerInfo->getLayerName(), 
                                               DXFABS(this->colorNumber));
  }
  if (!copyRecords(l, model)) {
    // check if allocated on heap.
    if (!memh) delete l;
    l = NULL;
  }
  return l;
}
Exemplo n.º 8
0
dimeUnknownObject::dimeUnknownObject(const char * const name, 
				 dimeMemHandler * const memhandler)
{
  DXF_STRCPY(memhandler, this->objectName, name);
}
Exemplo n.º 9
0
dimeUnknownTable::dimeUnknownTable(const char * const name, 
				 dimeMemHandler * const memhandler)
{
  DXF_STRCPY(memhandler, this->tableName, name);
}
Exemplo n.º 10
0
dimeUnknownEntity::dimeUnknownEntity(const char * const name, 
				   dimeMemHandler * const memhandler)
{
  DXF_STRCPY(memhandler, this->entityName, name);
}