SectorZone: add attribute arc_boundary
[xcsoar.git] / src / FLARM / FlarmNetRecord.hpp
blob784e7d09ee6b87693acb61d6a0624d191e9dedca
1 /*
2 Copyright_License {
4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #ifndef XCSOAR_FLARM_NET_RECORD_HPP
25 #define XCSOAR_FLARM_NET_RECORD_HPP
27 #include "Util/StaticString.hpp"
28 #include "Compiler.h"
30 #include <tchar.h>
32 class FlarmId;
34 constexpr
35 static inline size_t
36 LatinBufferSize(size_t size)
38 #ifdef _UNICODE
39 /* with wide characters, the exact size of the FLARMNet database field
40 (plus one for the terminator) is just right, ... */
41 return size;
42 #else
43 /* ..., but when we convert Latin-1 to UTF-8, we need a little bit
44 more buffer */
45 return size * 3 / 2 + 1;
46 #endif
49 /**
50 * FlarmNet.org file entry
52 struct FlarmNetRecord {
53 /**< FLARM id 6 bytes */
54 StaticString<LatinBufferSize(7)> id;
56 /**< Name 15 bytes */
57 StaticString<LatinBufferSize(22)> pilot;
59 /**< Airfield 4 bytes */
60 StaticString<LatinBufferSize(22)> airfield;
62 /**< Aircraft type 1 byte */
63 StaticString<LatinBufferSize(22)> plane_type;
65 /**< Registration 7 bytes */
66 StaticString<LatinBufferSize(8)> registration;
68 /**< Callsign 3 bytes */
69 StaticString<LatinBufferSize(4)> callsign;
71 /**< Radio frequency 6 bytes */
72 StaticString<LatinBufferSize(8)> frequency;
74 gcc_pure
75 FlarmId GetId() const;
78 #endif