-
Notifications
You must be signed in to change notification settings - Fork 0
/
JointsElement.cpp
77 lines (53 loc) · 1.42 KB
/
JointsElement.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "stdafx.h"
#include "JointsElement.h"
JointsElement::JointsElement()
{
attrCount = 0; // 初期化
}
JointsElement::~JointsElement()
{
ClearVector(vecElemInput);
}
void JointsElement::ReadNode(const DOMNode* node)
{
_ASSERTE(node != NULL);
ReadAttributes( node );
DOMNode* currentNode = node->getFirstChild();
while( currentNode != NULL )
{
#if _DEBUG // デバッグ時に名前をチェックする為に
const XMLCh* name = currentNode->getNodeName();
#endif
if( IsElementNode( currentNode ) )
{
if( Is_input_NodeName( currentNode ) )
{
InputElement* elemInput = new InputElement();
elemInput->ReadNode( currentNode );
vecElemInput.push_back( elemInput );
}
}
currentNode = currentNode->getNextSibling(); // 次の要素を処理する
}
}
bool JointsElement::ValidElements(std::wstring& message) const
{
std::wstring str;
if( vecElemInput.size() < 2 ) { str += L"<input>要素が2つ以上存在しません\n"; }
ValidElementsInContainer( vecElemInput, str );
if( str.empty() == false )
{
InsertTabEachLine( str );
message += L"<joints>\n" + str;
}
return str.empty();
}
void JointsElement::ReadAttributes(const DOMNode* node)
{
_ASSERTE(node != NULL);
DOMNamedNodeMap* attr = node->getAttributes();
if( attr == NULL ) { return; }
SetStringValue( attrId, Get_id_Attribute( attr ) );
SetStringValue( attrName, Get_name_Attribute( attr ) );
SetUIntValue( attrCount, Get_count_Attribute( attr ) );
}