This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finished initial implementation of format expression parsing.
- Loading branch information
Showing
9 changed files
with
173 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,7 @@ enum class Kind : int32_t { | |
Any, | ||
All, | ||
Comparison, | ||
FormatExpression, | ||
}; | ||
|
||
class Expression { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#pragma once | ||
|
||
#include <mbgl/util/optional.hpp> | ||
|
||
#include <vector> | ||
#include <string> | ||
|
||
namespace mbgl { | ||
namespace style { | ||
namespace expression { | ||
|
||
struct FormattedSection { | ||
FormattedSection(std::string text_, optional<double> fontScale_, optional<std::string> fontStack_) | ||
: text(std::move(text_)) | ||
, fontScale(std::move(fontScale_)) | ||
, fontStack(std::move(fontStack_)) | ||
{} | ||
std::string text; | ||
optional<double> fontScale; | ||
optional<std::string> fontStack; | ||
}; | ||
|
||
class Formatted { | ||
public: | ||
Formatted(std::vector<FormattedSection> sections_) | ||
: sections(std::move(sections_)) | ||
{} | ||
|
||
bool operator==(const Formatted& ) const { | ||
return false; // TODO | ||
} | ||
private: | ||
std::vector<FormattedSection> sections; | ||
}; | ||
|
||
} // namespace expression | ||
} // namespace style | ||
} // namespace mbgl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include <mbgl/style/expression/formatted.hpp> | ||
|
Oops, something went wrong.