AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MimeUtils.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_TEST_AVSCOMMON_UTILS_COMMON_MIMEUTILS_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_TEST_AVSCOMMON_UTILS_COMMON_MIMEUTILS_H_
18 
19 #include <memory>
20 #include <string>
21 #include <vector>
22 
25 
27 
28 namespace alexaClientSDK {
29 namespace avsCommon {
30 namespace utils {
31 
35 class TestMimePart {
36 public:
44  virtual std::string getMimeString() const = 0;
45 
53  virtual bool validateMimeParsing() = 0;
54 };
55 
61 public:
72  const std::string& boundaryString,
73  int dataSize,
74  std::shared_ptr<TestableMessageObserver> messageObserver);
75 
86  const std::string& mimeString,
87  const std::string& message,
88  std::shared_ptr<TestableMessageObserver> messageObserver);
89 
90  std::string getMimeString() const override;
91  virtual bool validateMimeParsing() override;
92 
93 private:
95  std::string m_message;
98  std::shared_ptr<TestableMessageObserver> m_messageObserver;
100  std::string m_mimeString;
101 };
102 
108 public:
120  const std::string& boundaryString,
121  const std::string& contextId,
122  const std::string contentId,
123  int dataSize,
124  std::shared_ptr<avsCommon::avs::attachment::AttachmentManager> attachmentManager);
125 
126  std::string getMimeString() const override;
127  virtual bool validateMimeParsing() override;
128 
129 private:
131  std::string m_contextId;
133  std::string m_contentId;
136  std::string m_attachmentData;
138  std::shared_ptr<avsCommon::avs::attachment::AttachmentManager> m_attachmentManager;
140  std::string m_mimeString;
141 };
142 
154  const std::vector<std::shared_ptr<TestMimePart>>& mimeParts,
155  const std::string& boundaryString,
156  bool addPrependedNewline = true);
157 
158 } // namespace utils
159 } // namespace avsCommon
160 } // namespace alexaClientSDK
161 
162 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_TEST_AVSCOMMON_UTILS_COMMON_MIMEUTILS_H_
std::string constructTestMimeString(const std::vector< std::shared_ptr< TestMimePart >> &mimeParts, const std::string &boundaryString, bool addPrependedNewline=true)
Definition: MimeUtils.cpp:113
::std::string string
Definition: gtest-port.h:1097
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
virtual std::string getMimeString() const =0
tuple message
Definition: gtest_output_test.py:331

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0