Skip to content

Commit

Permalink
Code style and formatting
Browse files Browse the repository at this point in the history
No functionality changes.
  • Loading branch information
nnaumenko committed Oct 1, 2019
1 parent 12a9fde commit aed226c
Show file tree
Hide file tree
Showing 51 changed files with 6,481 additions and 6,464 deletions.
4 changes: 2 additions & 2 deletions docs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
author = 'Nick Naumenko'

# The short X.Y version
version = '3.3.1'
version = '3.3.2'
# The full version, including alpha/beta/rc tags
release = '3.3.1'
release = '3.3.2'


# -- General configuration ---------------------------------------------------
Expand Down
92 changes: 46 additions & 46 deletions docs/sphinx/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Integrating Metaf

To integrate Metaf library into your project, just add the include path to directory ``include``. Then add the following line to the beginning of the ``tutorial.cpp`` ::

#include "metaf.h"
#include "metaf.hpp"

using namespace metaf;

Expand Down Expand Up @@ -92,13 +92,13 @@ Add the following function before ``main()``: ::
std::string reportTypeMessage(ReportType reportType) {
switch (reportType) {
case ReportType::UNKNOWN:
return("unable to detect");
return "unable to detect";
case ReportType::METAR:
return("METAR");
return "METAR";
case ReportType::TAF:
return("TAF");
return "TAF";
}
}

Expand Down Expand Up @@ -133,46 +133,46 @@ Add the following function before ``main()``: ::
std::string errorMessage(ReportError error) {
switch (error) {
case ReportError::NONE:
return("no error");
return "no error";

case ReportError::EMPTY_REPORT:
return("empty report");
return "empty report";

case ReportError::EXPECTED_REPORT_TYPE_OR_LOCATION:
return("expected report type or ICAO location");
return "expected report type or ICAO location";

case ReportError::EXPECTED_LOCATION:
return("expected ICAO location");
return "expected ICAO location";

case ReportError::EXPECTED_REPORT_TIME:
return("expected report time");
return "expected report time";

case ReportError::EXPECTED_TIME_SPAN:
return("expected time span");
return "expected time span";

case ReportError::UNEXPECTED_REPORT_END:
return("unexpected report end");
return "unexpected report end";

case ReportError::UNEXPECTED_GROUP_AFTER_NIL:
return("unexpected group after NIL");
return "unexpected group after NIL";

case ReportError::UNEXPECTED_GROUP_AFTER_CNL:
return("unexpected group after CNL");
return "unexpected group after CNL";

case ReportError::UNEXPECTED_GROUP_AFTER_MAINTENANCE_INDICATOR:
return("unexpected group after maintenance indicator");
return "unexpected group after maintenance indicator";

case ReportError::UNEXPECTED_NIL_OR_CNL_IN_REPORT_BODY:
return("unexpected NIL or CNL in report body");
return "unexpected NIL or CNL in report body";

case ReportError::AMD_ALLOWED_IN_TAF_ONLY:
return("AMD is allowed in TAF only");
return "AMD is allowed in TAF only";

case ReportError::CNL_ALLOWED_IN_TAF_ONLY:
return("CNL is allowed in TAF only");
return "CNL is allowed in TAF only";

case ReportError::MAINTENANCE_INDICATOR_ALLOWED_IN_METAR_ONLY:
return("Maintenance indicator is allowed only in METAR reports");
return "Maintenance indicator is allowed only in METAR reports";
}
}

Expand Down Expand Up @@ -208,7 +208,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Fixed Text: " + rawString);
return ("Fixed Text: " + rawString);
}

virtual std::string visitLocationGroup(
Expand All @@ -217,7 +217,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("ICAO location: " + rawString);
return ("ICAO location: " + rawString);
}

virtual std::string visitReportTimeGroup(
Expand All @@ -226,7 +226,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Report Release Time: " + rawString);
return ("Report Release Time: " + rawString);
}

virtual std::string visitTrendGroup(
Expand All @@ -235,7 +235,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Trend Header: " + rawString);
return ("Trend Header: " + rawString);
}

virtual std::string visitWindGroup(
Expand All @@ -244,7 +244,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Wind: " + rawString);
return ("Wind: " + rawString);
}

virtual std::string visitVisibilityGroup(
Expand All @@ -253,7 +253,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Visibility: " + rawString);
return ("Visibility: " + rawString);
}

virtual std::string visitCloudGroup(
Expand All @@ -262,7 +262,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Cloud Data: " + rawString);
return ("Cloud Data: " + rawString);
}

virtual std::string visitWeatherGroup(
Expand All @@ -271,7 +271,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Weather Phenomena: " + rawString);
return ("Weather Phenomena: " + rawString);
}

virtual std::string visitTemperatureGroup(
Expand All @@ -280,7 +280,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Temperature and Dew Point: " + rawString);
return ("Temperature and Dew Point: " + rawString);
}

virtual std::string visitTemperatureForecastGroup(
Expand All @@ -289,7 +289,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Tempreature Forecast: " + rawString);
return ("Tempreature Forecast: " + rawString);
}

virtual std::string visitPressureGroup(
Expand All @@ -298,7 +298,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Pressure: " + rawString);
return ("Pressure: " + rawString);
}

virtual std::string visitRunwayVisualRangeGroup(
Expand All @@ -307,7 +307,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Runway Visual Range: " + rawString);
return ("Runway Visual Range: " + rawString);
}

virtual std::string visitRunwayStateGroup(
Expand All @@ -316,7 +316,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("State of Runway:" + rawString);
return ("State of Runway:" + rawString);
}

virtual std::string visitSecondaryLocationGroup(
Expand All @@ -325,7 +325,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Information on Secondary Location: " + rawString);
return ("Information on Secondary Location: " + rawString);
}

virtual std::string visitRainfallGroup(
Expand All @@ -334,7 +334,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Rainfall: " + rawString);
return ("Rainfall: " + rawString);
}

virtual std::string visitSeaSurfaceGroup(
Expand All @@ -343,7 +343,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Sea Surface: " + rawString);
return ("Sea Surface: " + rawString);
}

virtual std::string visitColourCodeGroup(
Expand All @@ -352,7 +352,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Colour Code: " + rawString);
return ("Colour Code: " + rawString);
}

virtual std::string visitMinMaxTemperatureGroup(
Expand All @@ -361,7 +361,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Minimum/Maximum Temperature: " + rawString);
return ("Minimum/Maximum Temperature: " + rawString);
}

virtual std::string visitPrecipitationGroup(
Expand All @@ -370,7 +370,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Precipitation: " + rawString);
return ("Precipitation: " + rawString);
}

virtual std::string visitLayerForecastGroup(
Expand All @@ -379,7 +379,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Atmospheric Layer Forecast: " + rawString);
return ("Atmospheric Layer Forecast: " + rawString);
}

virtual std::string visitPressureTendencyGroup(
Expand All @@ -388,7 +388,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Pressure Tendency: " + rawString);
return ("Pressure Tendency: " + rawString);
}

virtual std::string visitCloudTypesGroup(
Expand All @@ -397,7 +397,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Cloud Types: " + rawString);
return ("Cloud Types: " + rawString);
}

virtual std::string visitCloudLayersGroup(
Expand All @@ -406,7 +406,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Cloud Layers: " + rawString);
return ("Cloud Layers: " + rawString);
}

virtual std::string visitLightningGroup(
Expand All @@ -415,7 +415,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Lightning data: " + rawString);
return ("Lightning data: " + rawString);
}

virtual std::string visitWeatherBeginEndGroup(
Expand All @@ -424,7 +424,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Weather phenomena beginning and ending: " + rawString);
return ("Weather phenomena beginning and ending: " + rawString);
}

virtual std::string visitVicinityGroup(
Expand All @@ -433,7 +433,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Events in vicinity: " + rawString);
return ("Events in vicinity: " + rawString);
}

virtual std::string visitMiscGroup(
Expand All @@ -442,7 +442,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Miscellaneous Data: " + rawString);
return ("Miscellaneous Data: " + rawString);
}

virtual std::string visitUnknownGroup(
Expand All @@ -451,7 +451,7 @@ Now add to class MyVisitor the following group handling methods ::
const std::string & rawString)
{
(void)group; (void)reportPart;
return("Not recognised by the parser: " + rawString);
return ("Not recognised by the parser: " + rawString);
}

We just print the type of group and its raw string here. To avoid unused parameter warnings we cast parameters to ``void``). In more complex applications you want to check the fields of the groups and print or process their data; check examples section for such usage.
Expand Down
Loading

0 comments on commit aed226c

Please sign in to comment.