Twitch SDK (Internal)
chatgetdisplayinfotask.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * Twitch Broadcasting SDK
3 *
4 * This software is supplied under the terms of a license agreement with Twitch Interactive, Inc. and
5 * may not be copied or used except in accordance with the terms of that agreement
6 * Copyright (c) 2012-2016 Twitch Interactive, Inc.
7 *********************************************************************************************/
8 
9 #pragma once
10 
13 #include <memory>
14 
15 namespace ttv
16 {
17  namespace chat
18  {
19  class ChatGetDisplayInfoTask;
20  }
21 }
22 
24 {
25 public:
26  struct Result
27  {
28  struct BadgeInfo
29  {
30  template <typename IdStringType, typename VersionStringType>
31  BadgeInfo(IdStringType&& passedSetId, VersionStringType&& passedVersion)
32  : setId(std::forward<IdStringType>(passedSetId))
33  , version(std::forward<VersionStringType>(passedVersion)) {}
34 
35  std::string setId;
36  std::string version;
37  };
38 
39  Result();
40 
41  std::vector<BadgeInfo> badgeInfos;
43  };
44 
45  typedef std::function<void(ChatGetDisplayInfoTask* source, TTV_ErrorCode ec, std::shared_ptr<Result> result)> Callback;
46 
47 public:
48  ChatGetDisplayInfoTask(UserId userId, Callback callback);
49 
50 protected:
51  virtual const char* GetTaskName() const override { return "ChatGetDisplayInfoTask"; }
52 
53  virtual void FillHttpRequestInfo(HttpRequestInfo& requestInfo) override;
54  virtual void ProcessResponse(uint statusCode, const std::vector<char>& response) override;
55  virtual void OnComplete() override;
56 
57 private:
58  std::shared_ptr<Result> mResult;
61 };
ChatGetDisplayInfoTask(UserId userId, Callback callback)
uint32_t UserId
Definition: coretypes.h:22
virtual void FillHttpRequestInfo(HttpRequestInfo &requestInfo) override
std::shared_ptr< Result > mResult
Definition: chatgetdisplayinfotask.h:58
virtual void ProcessResponse(uint statusCode, const std::vector< char > &response) override
UserId mUserId
Definition: chatgetdisplayinfotask.h:60
Definition: chatgetdisplayinfotask.h:28
Callback mCallback
Definition: chatgetdisplayinfotask.h:59
Definition: chatgetdisplayinfotask.h:23
Definition: cpp11transition.h:22
Definition: httptask.h:19
virtual void OnComplete() override
virtual const char * GetTaskName() const override
Definition: chatgetdisplayinfotask.h:51
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
std::function< void(ChatGetDisplayInfoTask *source, TTV_ErrorCode ec, std::shared_ptr< Result > result)> Callback
Definition: chatgetdisplayinfotask.h:45
Color color
Definition: chatgetdisplayinfotask.h:42
std::string version
Definition: chatgetdisplayinfotask.h:36
Definition: chatgetdisplayinfotask.h:26
unsigned int uint
Definition: coretypes.h:18
std::string setId
Definition: chatgetdisplayinfotask.h:35
BadgeInfo(IdStringType &&passedSetId, VersionStringType &&passedVersion)
Definition: chatgetdisplayinfotask.h:31
uint32_t Color
Definition: coretypes.h:28
std::vector< BadgeInfo > badgeInfos
Definition: chatgetdisplayinfotask.h:41
Definition: httptask.h:22