updated documentation

This commit is contained in:
tastytea 2018-01-15 15:34:18 +01:00
parent 013a67bbe0
commit 80df5cafff
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
4 changed files with 35 additions and 3 deletions

View File

@ -77,8 +77,8 @@ WARN_FORMAT = "$file:$line: $text"
INPUT_ENCODING = UTF-8
RECURSIVE = NO
EXCLUDE_SYMLINKS = NO
EXAMPLE_PATH = examples
EXAMPLE_RECURSIVE = NO
EXAMPLE_PATH = src/examples
EXAMPLE_RECURSIVE = YES
FILTER_SOURCE_FILES = NO
SOURCE_BROWSER = NO
INLINE_SOURCES = YES

View File

@ -41,7 +41,7 @@ Install with `make install`.
# Usage
The HTML reference can be generated with `build_doc.sh`, if doxygen is installed. Or just look in `src/mastodon-cpp.hpp`. There is an example in `src/examples/`.
The HTML reference can be generated with `build_doc.sh`, if doxygen is installed. Or just look in `src/mastodon-cpp.hpp`. There are examples in `src/examples/`.
## Compiling your project

View File

@ -60,6 +60,15 @@ int main(int argc, char *argv[])
// if answer is "[]" there are none at all
if (answer != "" && answer != "[]")
{
string ornament = " +++++";
for (std::uint8_t i = hashtag.size(); i > 0; --i)
{
ornament += "+";
}
cout << ornament << '\n';
cout << " + " << hashtag << ": +\n";
cout << ornament << '\n';
std::istringstream iss(answer);
pt::ptree tree;
@ -78,6 +87,10 @@ int main(int argc, char *argv[])
<< " (" << toot.second.get<string>("account.acct") << ") at "
<< toot.second.get<string>("created_at") << "\n";
cout << " " << toot.second.get<string>("url") << '\n';
for (const pt::ptree::value_type &media : toot.second.get_child("media_attachments"))
{
cout << "Attachment: <" << media.second.get<string>("url") << ">\n";
}
cout << "++++++++\n";
}

View File

@ -23,8 +23,27 @@
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
/*!
* @example example1_dump_json.cpp
* @example example2_parse_account.cpp
* @example example3_mastocron.cpp
*/
namespace Mastodon
{
/*!
* @brief Class for the Mastodon API.
* @section error Error codes
* | Code | Explanation |
* | --------: |:------------------------------|
* | 0 | No error |
* | 1 | Invalid call |
* | 2 | Not implemented |
* | 16 | Connection failed |
* | 17 | TLS error |
* | 18 | Invalid response from server |
* | 100 - 999 | HTTP status codes |
* | 65535 | Unknown exception |
*/
class API
{
public: