Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
63dc0b4f
Kaydet (Commit)
63dc0b4f
authored
Şub 25, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert INETMSG_MIME_VERSION constants to enum class
Change-Id: Iaa2518f7f491f4e0e316dcb8695cf1275ffe8149
üst
1e4f2cc1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
44 deletions
+45
-44
inetmsg.hxx
include/tools/inetmsg.hxx
+17
-14
inetmsg.cxx
tools/source/inet/inetmsg.cxx
+28
-30
No files found.
include/tools/inetmsg.hxx
Dosyayı görüntüle @
63dc0b4f
...
...
@@ -106,13 +106,16 @@ enum class InetMessageField
NUMHDR
=
16
,
};
#define INETMSG_MIME_VERSION 0
#define INETMSG_MIME_CONTENT_DESCRIPTION 1
#define INETMSG_MIME_CONTENT_DISPOSITION 2
#define INETMSG_MIME_CONTENT_ID 3
#define INETMSG_MIME_CONTENT_TYPE 4
#define INETMSG_MIME_CONTENT_TRANSFER_ENCODING 5
#define INETMSG_MIME_NUMHDR 6
enum
class
InetMessageMime
{
VERSION
=
0
,
CONTENT_DESCRIPTION
=
1
,
CONTENT_DISPOSITION
=
2
,
CONTENT_ID
=
3
,
CONTENT_TYPE
=
4
,
CONTENT_TRANSFER_ENCODING
=
5
,
NUMHDR
=
6
,
};
enum
INetMessageContainerType
{
...
...
@@ -141,7 +144,7 @@ class TOOLS_DLLPUBLIC INetMIMEMessage
::
std
::
map
<
InetMessageField
,
sal_uIntPtr
>
m_nRFC822Index
;
sal_uIntPtr
m_nMIMEIndex
[
INETMSG_MIME_NUMHDR
]
;
::
std
::
map
<
InetMessageMime
,
sal_uIntPtr
>
m_nMIMEIndex
;
INetMIMEMessage
*
pParent
;
INetMIMEMessgeList_impl
aChildren
;
OString
m_aBoundary
;
...
...
@@ -361,35 +364,35 @@ public:
void
SetMIMEVersion
(
const
OUString
&
rVersion
);
OUString
GetMIMEVersion
()
const
{
return
GetHeaderValue
(
m_nMIMEIndex
[
INETMSG_MIME_VERSION
]
);
return
GetHeaderValue
(
m_nMIMEIndex
.
at
(
InetMessageMime
::
VERSION
)
);
}
OUString
GetContentDescription
()
const
{
return
GetHeaderValue
(
m_nMIMEIndex
[
INETMSG_MIME_CONTENT_DESCRIPTION
]
);
return
GetHeaderValue
(
m_nMIMEIndex
.
at
(
InetMessageMime
::
CONTENT_DESCRIPTION
)
);
}
void
SetContentDisposition
(
const
OUString
&
rDisposition
);
OUString
GetContentDisposition
()
const
{
return
GetHeaderValue
(
m_nMIMEIndex
[
INETMSG_MIME_CONTENT_DISPOSITION
]
);
return
GetHeaderValue
(
m_nMIMEIndex
.
at
(
InetMessageMime
::
CONTENT_DISPOSITION
)
);
}
OUString
GetContentID
()
const
{
return
GetHeaderValue
(
m_nMIMEIndex
[
INETMSG_MIME_CONTENT_ID
]
);
return
GetHeaderValue
(
m_nMIMEIndex
.
at
(
InetMessageMime
::
CONTENT_ID
)
);
}
void
SetContentType
(
const
OUString
&
rType
);
OUString
GetContentType
()
const
{
return
GetHeaderValue
(
m_nMIMEIndex
[
INETMSG_MIME_CONTENT_TYPE
]
);
return
GetHeaderValue
(
m_nMIMEIndex
.
at
(
InetMessageMime
::
CONTENT_TYPE
)
);
}
void
SetContentTransferEncoding
(
const
OUString
&
rEncoding
);
OUString
GetContentTransferEncoding
()
const
{
return
GetHeaderValue
(
m_nMIMEIndex
[
INETMSG_MIME_CONTENT_TRANSFER_ENCODING
]
);
return
GetHeaderValue
(
m_nMIMEIndex
.
at
(
InetMessageMime
::
CONTENT_TRANSFER_ENCODING
)
);
}
OUString
GetDefaultContentType
();
...
...
tools/source/inet/inetmsg.cxx
Dosyayı görüntüle @
63dc0b4f
...
...
@@ -88,7 +88,7 @@ void INetMIMEMessage::SetHeaderField_Impl (
INetMessageHeader
(
rName
,
aSink
.
takeBuffer
()),
rnIndex
);
}
static
std
::
map
<
InetMessageField
,
const
char
*>
ImplINetRFC822MessageHeaderData
=
static
const
std
::
map
<
InetMessageField
,
const
char
*>
ImplINetRFC822MessageHeaderData
=
{
{
InetMessageField
::
BCC
,
"BCC"
}
,
{
InetMessageField
::
CC
,
"CC"
}
,
...
...
@@ -492,7 +492,7 @@ sal_uIntPtr INetMIMEMessage::SetRFC822HeaderField (
case
INETMSG_RFC822_OK
:
pData
=
pStop
;
SetHeaderField_Impl
(
INetMessageHeader
(
ImplINetRFC822MessageHeaderData
[
nIdx
]
,
rHeader
.
GetValue
()
),
INetMessageHeader
(
ImplINetRFC822MessageHeaderData
.
at
(
nIdx
)
,
rHeader
.
GetValue
()
),
m_nRFC822Index
[
nIdx
]);
nNewIndex
=
m_nRFC822Index
[
nIdx
];
break
;
...
...
@@ -506,14 +506,14 @@ sal_uIntPtr INetMIMEMessage::SetRFC822HeaderField (
return
nNewIndex
;
}
static
const
char
*
ImplINetMIMEMessageHeaderData
[]
=
static
const
std
::
map
<
InetMessageMime
,
const
char
*>
ImplINetMIMEMessageHeaderData
=
{
"MIME-Version"
,
"Content-Description"
,
"Content-Disposition"
,
"Content-ID"
,
"Content-Type"
,
"Content-Transfer-Encoding"
{
InetMessageMime
::
VERSION
,
"MIME-Version"
}
,
{
InetMessageMime
::
CONTENT_DESCRIPTION
,
"Content-Description"
}
,
{
InetMessageMime
::
CONTENT_DISPOSITION
,
"Content-Disposition"
}
,
{
InetMessageMime
::
CONTENT_ID
,
"Content-ID"
}
,
{
InetMessageMime
::
CONTENT_TYPE
,
"Content-Type"
}
,
{
InetMessageMime
::
CONTENT_TRANSFER_ENCODING
,
"Content-Transfer-Encoding"
}
};
enum
_ImplINetMIMEMessageHeaderState
...
...
@@ -535,8 +535,8 @@ INetMIMEMessage::INetMIMEMessage()
{
for
(
sal_uInt16
i
=
0
;
i
<
static_cast
<
int
>
(
InetMessageField
::
NUMHDR
);
i
++
)
m_nRFC822Index
[
static_cast
<
InetMessageField
>
(
i
)]
=
CONTAINER_ENTRY_NOTFOUND
;
for
(
sal_uInt16
i
=
0
;
i
<
INETMSG_MIME_NUMHDR
;
i
++
)
m_nMIMEIndex
[
i
]
=
CONTAINER_ENTRY_NOTFOUND
;
for
(
sal_uInt16
i
=
0
;
i
<
static_cast
<
int
>
(
InetMessageMime
::
NUMHDR
)
;
i
++
)
m_nMIMEIndex
[
static_cast
<
InetMessageMime
>
(
i
)
]
=
CONTAINER_ENTRY_NOTFOUND
;
}
INetMIMEMessage
::
INetMIMEMessage
(
const
INetMIMEMessage
&
rMsg
)
...
...
@@ -585,9 +585,7 @@ void INetMIMEMessage::CopyImp (const INetMIMEMessage& rMsg)
bHeaderParsed
=
rMsg
.
bHeaderParsed
;
size_t
i
;
for
(
i
=
0
;
i
<
INETMSG_MIME_NUMHDR
;
i
++
)
m_nMIMEIndex
[
i
]
=
rMsg
.
m_nMIMEIndex
[
i
];
m_nMIMEIndex
=
rMsg
.
m_nMIMEIndex
;
m_aBoundary
=
rMsg
.
m_aBoundary
;
for
(
i
=
0
;
i
<
rMsg
.
aChildren
.
size
();
i
++
)
...
...
@@ -618,7 +616,7 @@ sal_uIntPtr INetMIMEMessage::SetHeaderField (
const
sal_Char
*
pStop
=
pData
+
aName
.
getLength
()
+
1
;
const
sal_Char
*
check
=
""
;
sal_uIntPtr
nIdx
=
CONTAINER_APPEND
;
InetMessageMime
nIdx
=
static_cast
<
InetMessageMime
>
(
CONTAINER_APPEND
)
;
int
eState
=
INETMSG_MIME_BEGIN
;
int
eOkState
=
INETMSG_MIME_OK
;
...
...
@@ -639,7 +637,7 @@ sal_uIntPtr INetMIMEMessage::SetHeaderField (
case
'm'
:
check
=
"ime-version"
;
nIdx
=
I
NETMSG_MIME_
VERSION
;
nIdx
=
I
netMessageMime
::
VERSION
;
break
;
default
:
...
...
@@ -661,7 +659,7 @@ sal_uIntPtr INetMIMEMessage::SetHeaderField (
case
'i'
:
check
=
"d"
;
nIdx
=
I
NETMSG_MIME_
CONTENT_ID
;
nIdx
=
I
netMessageMime
::
CONTENT_ID
;
break
;
case
't'
:
...
...
@@ -683,12 +681,12 @@ sal_uIntPtr INetMIMEMessage::SetHeaderField (
{
case
'e'
:
check
=
"scription"
;
nIdx
=
I
NETMSG_MIME_
CONTENT_DESCRIPTION
;
nIdx
=
I
netMessageMime
::
CONTENT_DESCRIPTION
;
break
;
case
'i'
:
check
=
"sposition"
;
nIdx
=
I
NETMSG_MIME_
CONTENT_DISPOSITION
;
nIdx
=
I
netMessageMime
::
CONTENT_DISPOSITION
;
break
;
default
:
...
...
@@ -706,12 +704,12 @@ sal_uIntPtr INetMIMEMessage::SetHeaderField (
{
case
'r'
:
check
=
"ansfer-encoding"
;
nIdx
=
I
NETMSG_MIME_
CONTENT_TRANSFER_ENCODING
;
nIdx
=
I
netMessageMime
::
CONTENT_TRANSFER_ENCODING
;
break
;
case
'y'
:
check
=
"pe"
;
nIdx
=
I
NETMSG_MIME_
CONTENT_TYPE
;
nIdx
=
I
netMessageMime
::
CONTENT_TYPE
;
break
;
default
:
...
...
@@ -741,7 +739,7 @@ sal_uIntPtr INetMIMEMessage::SetHeaderField (
case
INETMSG_MIME_OK
:
pData
=
pStop
;
SetHeaderField_Impl
(
INetMessageHeader
(
ImplINetMIMEMessageHeaderData
[
nIdx
]
,
rHeader
.
GetValue
()),
INetMessageHeader
(
ImplINetMIMEMessageHeaderData
.
at
(
nIdx
)
,
rHeader
.
GetValue
()),
m_nMIMEIndex
[
nIdx
]);
nNewIndex
=
m_nMIMEIndex
[
nIdx
];
break
;
...
...
@@ -759,24 +757,24 @@ void INetMIMEMessage::SetMIMEVersion (const OUString& rVersion)
{
SetHeaderField_Impl
(
INetMIME
::
HEADER_FIELD_TEXT
,
ImplINetMIMEMessageHeaderData
[
INETMSG_MIME_VERSION
]
,
rVersion
,
m_nMIMEIndex
[
I
NETMSG_MIME_
VERSION
]);
ImplINetMIMEMessageHeaderData
.
at
(
InetMessageMime
::
VERSION
)
,
rVersion
,
m_nMIMEIndex
[
I
netMessageMime
::
VERSION
]);
}
void
INetMIMEMessage
::
SetContentDisposition
(
const
OUString
&
rDisposition
)
{
SetHeaderField_Impl
(
INetMIME
::
HEADER_FIELD_TEXT
,
ImplINetMIMEMessageHeaderData
[
INETMSG_MIME_CONTENT_DISPOSITION
]
,
rDisposition
,
m_nMIMEIndex
[
I
NETMSG_MIME_
CONTENT_DISPOSITION
]);
ImplINetMIMEMessageHeaderData
.
at
(
InetMessageMime
::
CONTENT_DISPOSITION
)
,
rDisposition
,
m_nMIMEIndex
[
I
netMessageMime
::
CONTENT_DISPOSITION
]);
}
void
INetMIMEMessage
::
SetContentType
(
const
OUString
&
rType
)
{
SetHeaderField_Impl
(
INetMIME
::
HEADER_FIELD_TEXT
,
ImplINetMIMEMessageHeaderData
[
INETMSG_MIME_CONTENT_TYPE
]
,
rType
,
m_nMIMEIndex
[
I
NETMSG_MIME_
CONTENT_TYPE
]);
ImplINetMIMEMessageHeaderData
.
at
(
InetMessageMime
::
CONTENT_TYPE
)
,
rType
,
m_nMIMEIndex
[
I
netMessageMime
::
CONTENT_TYPE
]);
}
void
INetMIMEMessage
::
SetContentTransferEncoding
(
...
...
@@ -784,8 +782,8 @@ void INetMIMEMessage::SetContentTransferEncoding (
{
SetHeaderField_Impl
(
INetMIME
::
HEADER_FIELD_TEXT
,
ImplINetMIMEMessageHeaderData
[
INETMSG_MIME_CONTENT_TRANSFER_ENCODING
]
,
rEncoding
,
m_nMIMEIndex
[
I
NETMSG_MIME_
CONTENT_TRANSFER_ENCODING
]);
ImplINetMIMEMessageHeaderData
.
at
(
InetMessageMime
::
CONTENT_TRANSFER_ENCODING
)
,
rEncoding
,
m_nMIMEIndex
[
I
netMessageMime
::
CONTENT_TRANSFER_ENCODING
]);
}
OUString
INetMIMEMessage
::
GetDefaultContentType
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment