NDEVR
API Documentation
NDEVRFileServer.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2020, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVRFileServer
28File: NDEVRServerClientModule
29Included in API: True
30Author(s): tyler.parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/NDEVRCommunicationLogic.h>
35#include <NDEVR/ServerActions.h>
36#include <NDEVR/ApplicationOption.h>
37#include <NDEVR/BinaryFile.h>
38namespace NDEVR
39{
40 class TranslatedString;
45 {
46 e_generate_user = 3657209134
47 , e_update_user_info = 2121586039
48 , e_add_resource = 1419761428
49 , e_add_messages = 1219731429
50 , e_get_messages = 1319731429
51 , e_set_library_object = 1419761429
52 , e_check_resource_permission = 4065673245
53 , e_get_library_object = 3186158442
54 , e_get_library_objects = 3186158443
55 , e_add_resource_permission = 2194099266
56 , e_get_user_info = 1342278050
57 , e_get_users = 1342278051
58 , e_get_owned_resources = 2079475668
59 , e_get_shared_resources = 3145002989
60 , e_get_server_info = 1849382312
61 , e_get_resource = 3186158441
62 , e_get_resource_versions = 3576028443
63 , e_get_resource_permissions = 2982162499
64 , e_delete_resource = 4260773917
65 , e_delete_permission = 1027683853
66 };
67
70 class NDEVRSERVERCLIENT_API NDEVRFileServer : public PacketListener
71 {
72 public:
73 static uint04 client_version;
74 static uint04 server_version;
78 static TranslatedString RequestTypeToString(ServerRequestType type);
81 NDEVRFileServer(ServerActions* actions);
84 virtual void onReceive(NDEVRConnectionData& data) override;
88 virtual void onConnectionChanged(void*, bool is_connected) override;
92 bool connectToLocalDB(NDEVRServerInfo& info);
96 std::pair<String, Buffer<uint01>> getPreviewImage(const StringView& request) const;
101 ServerCommandReturn approveUser(const StringView& user_name, bool approve);
103 void updatePendingUsers();
105 void disconnectFromDB();
108 void setCommunication(NDEVRCommunicationLogic* comms);
111 const Dictionary<String, ServerUserInfo>& pendingUsers() const { return m_pending_users; };
117 void logAndPrepareResponse(const ServerCredentials& logged_creds, ServerRequestType request_type, const ServerCommandReturn& response, BinaryFile& encoding);
118 static ApplicationOption<bool> auto_approve_users;
119 static ApplicationOption<bool> auto_start_server;
120 static ApplicationOption<File> resource_location;
121 private:
122 ServerUserInfo m_admin;
123 Dictionary<String, ServerUserInfo> m_pending_users;
124 NDEVRCommunicationLogic* m_comms = nullptr;
125 ServerActions* m_server_actions;
126 };
127}
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
ServerRequestType
Enumerates the types of requests that can be sent between NDEVR file clients and servers.