-
Notifications
You must be signed in to change notification settings - Fork 0
/
TransmissionMessage.cpp
80 lines (78 loc) · 2.68 KB
/
TransmissionMessage.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
78
79
80
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "TransmissionMessage.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
//---------------------------------------------------------------------------
__fastcall TTransmissionMessage::TTransmissionMessage()
{
Created = Now();
Msg = new AnsiString();
FromHostAddr = new AnsiString();
FromHostName = new AnsiString();
}
//---------------------------------------------------------------------------
__fastcall TTransmissionMessage::~TTransmissionMessage()
{
delete Msg;
delete FromHostAddr;
delete FromHostName;
}
//---------------------------------------------------------------------------
void __fastcall TTransmissionMessage::SetMessage(AnsiString m)
{
*Msg = m;
Modified = Now();
}
//---------------------------------------------------------------------------
void __fastcall TTransmissionMessage::SetMessage(TStringList *m)
{
*Msg = m->Text;
if ((Msg->SubString(Msg->Length(), 1) == "\r") || (Msg->SubString(Msg->Length(), 1) == "\n"))
Msg->Delete(Msg->Length(), 1);
if ((Msg->SubString(Msg->Length(), 1) == "\r") || (Msg->SubString(Msg->Length(), 1) == "\n"))
Msg->Delete(Msg->Length(), 1);
Modified = Now();
}
//---------------------------------------------------------------------------
AnsiString * __fastcall TTransmissionMessage::GetFromHostAddr()
{
return FromHostAddr;
}
//---------------------------------------------------------------------------
void __fastcall TTransmissionMessage::SetFromHostAddr(AnsiString fh)
{
*FromHostAddr = fh;
}
//---------------------------------------------------------------------------
AnsiString * __fastcall TTransmissionMessage::GetFromHostName()
{
return FromHostName;
}
//---------------------------------------------------------------------------
void __fastcall TTransmissionMessage::SetFromHostName(AnsiString fn)
{
*FromHostName = fn;
}
//---------------------------------------------------------------------------
int __fastcall TTransmissionMessage::GetMessageLines()
{
return Msg->Length();
}
//---------------------------------------------------------------------------
int __fastcall TTransmissionMessage::GetMessageSize()
{
return Msg->Length();
}
//---------------------------------------------------------------------------
TDateTime __fastcall TTransmissionMessage::GetMessageCreated()
{
return Created;
}
//---------------------------------------------------------------------------
TDateTime __fastcall TTransmissionMessage::GetMessageModified()
{
return Modified;
}
//---------------------------------------------------------------------------