1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: boss_TaskQuery.h 4 5 Copyright (C)2009-2012 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 46667 $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef NN_BOSS_BOSS_TASK_QUERY_H_ 17 #define NN_BOSS_BOSS_TASK_QUERY_H_ 18 19 #include <nn/boss/boss_Const.h> 20 #include <nn/boss/boss_Result.h> 21 #include <nn/boss/boss_Types.h> 22 23 #ifdef __cplusplus 24 25 namespace nn { 26 namespace boss { 27 28 /* Please see man pages for details 29 30 */ 31 class TaskQuery 32 { 33 public: 34 /* Please see man pages for details 35 36 */ 37 explicit TaskQuery(void); 38 39 /* Please see man pages for details 40 41 */ 42 virtual ~TaskQuery(void); 43 44 /* Please see man pages for details 45 46 47 48 49 50 */ 51 nn::Result Initialize(void); 52 53 /* Please see man pages for details 54 55 56 57 */ 58 u8 GetSize(void); 59 60 /* Please see man pages for details 61 62 63 64 65 66 67 68 69 70 */ 71 nn::Result GetType(u8 index, QueryType* pType); 72 73 /* Please see man pages for details 74 75 76 77 78 79 80 81 82 83 84 */ 85 nn::Result GetName(u8 index, char* pName, size_t size); 86 87 /* Please see man pages for details 88 89 90 91 92 93 94 95 96 97 98 */ 99 nn::Result GetValue(u8 index, void* pValue, size_t size); 100 101 /* Please see man pages for details 102 103 104 105 106 107 108 109 110 111 112 */ 113 nn::Result AddQuery(const char* pName, const char* pValue); 114 115 /* Please see man pages for details 116 117 118 119 120 121 122 123 124 125 126 127 */ 128 nn::Result AddQuery(const char* pName, s32 value, bool hex = false) { return AddQuery(pName, &value, sizeof(s32), hex ? QUERYTYPE_HEX_S32 : QUERYTYPE_S32); } 129 130 /* Please see man pages for details 131 132 133 134 135 136 137 138 139 140 141 142 */ 143 nn::Result AddQuery(const char* pName, u32 value, bool hex = false) { return AddQuery(pName, &value, sizeof(u32), hex ? QUERYTYPE_HEX_U32 : QUERYTYPE_U32); } 144 145 /* Please see man pages for details 146 147 148 149 150 151 152 153 154 155 156 157 */ 158 nn::Result AddQuery(const char* pName, s64 value, bool hex = false) { return AddQuery(pName, &value, sizeof(s64), hex ? QUERYTYPE_HEX_S64 : QUERYTYPE_S64); } 159 160 /* Please see man pages for details 161 162 163 164 165 166 167 168 169 170 171 172 */ 173 nn::Result AddQuery(const char* pName, u64 value, bool hex = false) { return AddQuery(pName, &value, sizeof(u64), hex ? QUERYTYPE_HEX_U64 : QUERYTYPE_U64); } 174 175 protected: 176 nn::Result AddQuery(const char* pName, const void* pValue, size_t size, QueryType type); 177 u8 GetNextIndex(void); 178 bool IsValidIndex(u8 index); 179 180 friend class AccessConfig; 181 TaskQueryConfig m_Query; 182 }; 183 184 } 185 } 186 187 #endif 188 189 #endif /* NN_BOSS_BOSS_TASK_QUERY_H_ */ 190