attribute.cpp

来自「uml编辑器很牛」· C++ 代码 · 共 90 行

CPP
90
字号
/* ==========================================================================
	Class :			CAttribute

	Author :		Johan Rosengren, Abstrakt Mekanik AB

	Date :			06/02/04

	Purpose :		The "CAttribute" class - derived from "CObject" - represents 
					a single attribute in an UML-class. The attributes are 
					stored in a "CObArray" in the "CAttributeContainer" class.

	Description :	The class is mainly a holder for attribute attributes (!) 
					and functions to create them and get string 
					representations in different formats.

	Usage :			Create and store in a "CAttributeContainer" instance.

   ========================================================================*/

#include "stdafx.h"
#include "Attribute.h"
#include "DiagramEditor/Tokenizer.h"
#include "StringHelpers.h"
#include "UMLEntity.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

// Construction/destruction
CAttribute::CAttribute()
/* ============================================================
	Function :		CAttribute::CAttribute
	Description :	Constructor
	Access :		Public

	Return :		void
	Parameters :	none

	Usage :			

   ============================================================*/
{

	maintype = 0;
	access = 0;

}

CAttribute::~CAttribute()
/* ============================================================
	Function :		CAttribute::~CAttribute
	Description :	Destructor					
	Access :		Public

	Return :		void
	Parameters :	none

	Usage :			

   ============================================================*/
{
}

// Implementation
CString CAttribute::ToString( BOOL nomarkers )
/* ============================================================
	Function :		CAttribute::ToString
	Description :	Returns a string representation in UML-
					format for presenting the attribute 
					on screen.
	Access :		Public

	Return :		
	Parameters :	CAttribute* obj	-	Attribute to display
					BOOL nomarkers	-	If access markers should 
										be displayed or hidden.

	Usage :			Call to get a string to display on screen. 
					The function takes display settings into 
					consideration.

   ============================================================*/
{

	CString output;
	if( stereotype.GetLength() )
		output = _T( "

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?