Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
a2db142d
Commit
a2db142d
authored
Oct 19, 2006
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added warnings to Reader, fixed some bugs found that way
parent
84717dac
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
5 deletions
+30
-5
src/data/field.cpp
src/data/field.cpp
+4
-1
src/data/field/choice.cpp
src/data/field/choice.cpp
+1
-1
src/mse.vcproj
src/mse.vcproj
+12
-0
src/util/io/reader.cpp
src/util/io/reader.cpp
+4
-0
src/util/io/reader.hpp
src/util/io/reader.hpp
+9
-3
No files found.
src/data/field.cpp
View file @
a2db142d
...
...
@@ -37,6 +37,8 @@ IMPLEMENT_REFLECTION(Field) {
String
type
=
typeName
();
REFLECT
(
type
);
}
REFLECT
(
name
);
REFLECT
(
description
);
REFLECT
(
editable
);
REFLECT
(
save_value
);
REFLECT
(
show_statistics
);
...
...
@@ -44,7 +46,8 @@ IMPLEMENT_REFLECTION(Field) {
REFLECT
(
card_list_column
);
REFLECT
(
card_list_width
);
REFLECT
(
card_list_allow
);
REFLECT
(
card_list_align
);
REFLECT
(
card_list_name
);
REFLECT_N
(
"card_list_alignment"
,
card_list_align
);
REFLECT
(
tab_index
);
}
...
...
src/data/field/choice.cpp
View file @
a2db142d
...
...
@@ -31,7 +31,7 @@ String ChoiceField::typeName() const {
IMPLEMENT_REFLECTION
(
ChoiceField
)
{
REFLECT_BASE
(
Field
);
REFLECT
(
choices
);
REFLECT
_N
(
"choices"
,
choices
->
choices
);
REFLECT
(
script
);
REFLECT_N
(
"default"
,
default_script
);
REFLECT
(
initial
);
...
...
src/mse.vcproj
View file @
a2db142d
...
...
@@ -711,6 +711,18 @@
</File>
<File
RelativePath=
".\data\field\symbol.cpp"
>
<FileConfiguration
Name=
"Debug|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
ObjectFile=
"$(IntDir)/$(InputName)1.obj"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Debug Unicode|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
ObjectFile=
"$(IntDir)/$(InputName)1.obj"
/>
</FileConfiguration>
</File>
<File
RelativePath=
".\data\field\symbol.hpp"
>
...
...
src/util/io/reader.cpp
View file @
a2db142d
...
...
@@ -20,6 +20,10 @@ Reader::Reader(const InputStreamP& input, String filename)
moveNext
();
}
void
Reader
::
warning
(
const
String
&
msg
)
{
wxMessageBox
((
msg
+
_
(
"
\n
On line: "
))
<<
line_number
<<
_
(
"
\n
In file: "
)
<<
filename
,
_
(
"Warning"
),
wxOK
|
wxICON_EXCLAMATION
);
}
bool
Reader
::
enterBlock
(
const
Char
*
name
)
{
if
(
just_opened
)
moveNext
();
// on the key of the parent block, first move inside it
if
(
indent
!=
expected_indent
)
return
false
;
// not enough indentation
...
...
src/util/io/reader.hpp
View file @
a2db142d
...
...
@@ -43,6 +43,9 @@ class Reader {
/// Is the thing currently being read 'complex', i.e. does it have children
inline
bool
isComplex
()
const
{
return
value
.
empty
();
}
/// Show a warning message, but continue reading
void
warning
(
const
String
&
msg
);
// --------------------------------------------------- : Handling objects
/// Handle an object: read it if it's name matches
template
<
typename
T
>
...
...
@@ -148,7 +151,8 @@ void Reader::handle(map<K,V>& map) {
UInt
l
=
line_number
;
\
object
.
reflect
(
*
this
);
\
if
(
l
==
line_number
)
{
\
/* error */
\
/* warning: unexpected key */
\
warning
(
_
(
"Unexpected key: '"
)
+
key
+
_
(
"'"
));
\
do
{
\
moveNext
();
\
}
while
(
indent
>
expected_indent
);
\
...
...
@@ -167,7 +171,8 @@ void Reader::handle(map<K,V>& map) {
EnumReader
reader
(
value
);
\
reflect_
##
Enum
(
enum_
,
reader
);
\
if
(
!
reader
.
isDone
())
{
\
/* warning message */
\
/* warning: unknown value */
\
warning
(
_
(
"Unrecognized value: "
)
+
value
);
\
}
\
}
...
...
@@ -181,7 +186,8 @@ class EnumReader {
template
<
typename
Enum
>
inline
void
handle
(
const
Char
*
name
,
Enum
value
,
Enum
&
enum_
)
{
if
(
!
done
&&
read
==
name
)
{
first
=
true
;
done
=
true
;
first
=
false
;
enum_
=
value
;
}
else
if
(
first
)
{
first
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment