From a32170b9a3cd3e738d4c622da716aa60f707ba3d Mon Sep 17 00:00:00 2001 From: An Tao Date: Sat, 12 Sep 2020 13:59:04 +0800 Subject: [PATCH] Modify the documentation of the method fileData() (#566) --- README.md | 1 - README.zh-CN.md | 2 +- lib/inc/drogon/MultiPart.h | 11 ++++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7671d88e..a2eb834c 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![Build Status](https://travis-ci.com/an-tao/drogon.svg?branch=master)](https://travis-ci.com/an-tao/drogon) [![Build status](https://ci.appveyor.com/api/projects/status/12ffuf6j5vankgyb/branch/master?svg=true)](https://ci.appveyor.com/project/an-tao/drogon/branch/master) [![Total alerts](https://img.shields.io/lgtm/alerts/g/an-tao/drogon.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/an-tao/drogon/alerts/) -[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/an-tao/drogon.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/an-tao/drogon/context:cpp) [![Join the chat at https://gitter.im/drogon-web/community](https://badges.gitter.im/drogon-web/community.svg)](https://gitter.im/drogon-web/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Docker image](https://img.shields.io/badge/Docker-image-blue.svg)](https://cloud.docker.com/u/drogonframework/repository/docker/drogonframework/drogon) diff --git a/README.zh-CN.md b/README.zh-CN.md index d61ca7d2..984deb7a 100755 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,8 +1,8 @@ ![](https://github.com/an-tao/drogon/wiki/images/drogon-white.jpg) [![Build Status](https://travis-ci.com/an-tao/drogon.svg?branch=master)](https://travis-ci.com/an-tao/drogon) +[![Build status](https://ci.appveyor.com/api/projects/status/12ffuf6j5vankgyb/branch/master?svg=true)](https://ci.appveyor.com/project/an-tao/drogon/branch/master) [![Total alerts](https://img.shields.io/lgtm/alerts/g/an-tao/drogon.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/an-tao/drogon/alerts/) -[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/an-tao/drogon.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/an-tao/drogon/context:cpp) [![Join the chat at https://gitter.im/drogon-web/community](https://badges.gitter.im/drogon-web/community.svg)](https://gitter.im/drogon-web/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Docker image](https://img.shields.io/badge/Docker-image-blue.svg)](https://cloud.docker.com/u/drogonframework/repository/docker/drogonframework/drogon) diff --git a/lib/inc/drogon/MultiPart.h b/lib/inc/drogon/MultiPart.h index e7b70613..f34b611c 100644 --- a/lib/inc/drogon/MultiPart.h +++ b/lib/inc/drogon/MultiPart.h @@ -78,7 +78,16 @@ class HttpFile /// Return the file length. size_t fileLength() const noexcept; - /// Return the file data. + /** + * @brief return the pointer of the file data. + * + * @return const char* + * @note This function just returns the beginning of the file data in + * memory. Users mustn't assume that there is an \0 character at the end of + * the file data even if the type of the file is text. One should get the + * length of the file by the fileLength() method, or use the fileContent() + * method. + */ const char *fileData() const noexcept; /// Return the md5 string of the file