aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.h
blob: 609b7905caf0985dc6cadfc2cebcbe48acccadd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
/* Generated from: FileChunkDownloadRequest.proto */

#ifndef PROTOBUF_C_FileChunkDownloadRequest_2eproto__INCLUDED
#define PROTOBUF_C_FileChunkDownloadRequest_2eproto__INCLUDED

#include <protobuf-c/protobuf-c.h>

PROTOBUF_C__BEGIN_DECLS

#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif


typedef struct _FileChunkDownloadRequest FileChunkDownloadRequest;


/* --- enums --- */


/* --- messages --- */

struct  _FileChunkDownloadRequest
{
  ProtobufCMessage base;
  char *downloadid;
  char *filename;
  protobuf_c_boolean has_position;
  int64_t position;
};
#define FILE_CHUNK_DOWNLOAD_REQUEST__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&file_chunk_download_request__descriptor) \
    , NULL, NULL, 0, 0 }


/* FileChunkDownloadRequest methods */
void   file_chunk_download_request__init
                     (FileChunkDownloadRequest         *message);
size_t file_chunk_download_request__get_packed_size
                     (const FileChunkDownloadRequest   *message);
size_t file_chunk_download_request__pack
                     (const FileChunkDownloadRequest   *message,
                      uint8_t             *out);
size_t file_chunk_download_request__pack_to_buffer
                     (const FileChunkDownloadRequest   *message,
                      ProtobufCBuffer     *buffer);
FileChunkDownloadRequest *
       file_chunk_download_request__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   file_chunk_download_request__free_unpacked
                     (FileChunkDownloadRequest *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*FileChunkDownloadRequest_Closure)
                 (const FileChunkDownloadRequest *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCMessageDescriptor file_chunk_download_request__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_FileChunkDownloadRequest_2eproto__INCLUDED */
ss="p">{ return GetTemplate(type.Name); } /// <summary> /// Gets a code template by name. /// </summary> /// <param name="name">The name.</param> /// <returns></returns> public static String GetTemplate(String name) { var assembly = Assembly.GetAssembly(typeof(Helper)); var resourceName = typeof(Helper).Namespace + ".Templates." + name + ".cshtml"; using (Stream stream = assembly.GetManifestResourceStream(resourceName)) { using (StreamReader reader = new StreamReader(stream)) { return reader.ReadToEnd(); } } } /// <summary> /// Parses the template using Razor Engine. /// </summary> /// <param name="template">The template.</param> /// <param name="model">The model.</param> /// <returns></returns> public static String ParseTemplate(String template, object model) { return Engine.Razor.RunCompile(template, Guid.NewGuid().ToString(), model.GetType(), model).Replace("<div>", "").Replace("</div>", ""); } /// <summary> /// Parses the specified text. /// </summary> /// <param name="text">The text.</param> /// <param name="model">The model.</param> /// <returns></returns> public static String Parse(String text,object model) { return Engine.Razor.RunCompile(text, Guid.NewGuid().ToString(), model.GetType(), model); } /// <summary> /// Indents the c sharp code. /// </summary> /// <param name="code">The code.</param> /// <returns></returns> public static string IndentCSharpCode(string code) { const string INDENT_STEP = " "; if (string.IsNullOrWhiteSpace(code)) { return code; } var result = new StringBuilder(); var indent = string.Empty; var lineContent = false; var stringDefinition = false; for (var i = 0; i < code.Length; i++) { var ch = code[i]; if (ch == '"' && !stringDefinition) { result.Append(ch); stringDefinition = true; continue; } if (ch == '"' && stringDefinition) { result.Append(ch); stringDefinition = false; continue; } if (stringDefinition) { result.Append(ch); continue; } if (ch == '{' && !stringDefinition) { if (lineContent) { result.AppendLine(); } result.Append(indent).Append("{"); if (lineContent) { result.AppendLine(); } indent += INDENT_STEP; lineContent = false; continue; } if (ch == '}' && !stringDefinition) { if (indent.Length != 0) { indent = indent.Substring(0, indent.Length - INDENT_STEP.Length); } if (lineContent) { result.AppendLine(); } result.Append(indent).Append("}"); if (lineContent) { result.AppendLine(); } lineContent = false; continue; } if (ch == '\r') { continue; } if ((ch == ' ' || ch == '\t') && !lineContent) { continue; } if (ch == '\n') { lineContent = false; result.AppendLine(); continue; } if (!lineContent) { result.Append(indent); lineContent = true; } result.Append(ch); } return result.ToString(); } } }