1 /*
2 * Copyright 2009-2017 Alibaba Cloud 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 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 
17 #include <alibabacloud/oss/OssResult.h>
18 #include <sstream>
19 
20 using namespace AlibabaCloud::OSS;
21 
OssResult()22 OssResult::OssResult() :
23     parseDone_(false)
24 {
25 }
26 
OssResult(const HeaderCollection & header)27 OssResult::OssResult(const HeaderCollection& header):
28     OssResult()
29 {
30     if (header.find("x-oss-request-id") != header.end()) {
31         requestId_ = header.at("x-oss-request-id");
32     }
33 }
34 
OssObjectResult()35 OssObjectResult::OssObjectResult() :
36     OssResult()
37 {
38 }
39 
OssObjectResult(const HeaderCollection & header)40 OssObjectResult::OssObjectResult(const HeaderCollection& header) :
41     OssResult(header)
42 {
43     if (header.find("x-oss-version-id") != header.end()) {
44         versionId_ = header.at("x-oss-version-id");
45     }
46 }
47