Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Vivy
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Elliu
Vivy
Validations
208d09e4
Vérifiée
Valider
208d09e4
rédigé
27 juin 2021
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
ASS: Add the base INI parser for the AssFactory
parent
b0eafae1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!3
Add documents
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/Ass/AssFactory.cc
+32
-3
32 ajouts, 3 suppressions
src/Ass/AssFactory.cc
src/Ass/AssFactory.hh
+1
-0
1 ajout, 0 suppression
src/Ass/AssFactory.hh
avec
33 ajouts
et
3 suppressions
src/Ass/AssFactory.cc
+
32
−
3
Voir le fichier @
208d09e4
...
...
@@ -6,10 +6,39 @@ bool
AssFactory
::
initFromStorage
()
noexcept
{
QTextStream
in
(
&
diskStorage
);
QString
currentSection
{};
quint64
lineIndex
=
0
;
while
(
!
in
.
atEnd
())
{
QString
line
=
in
.
readLine
();
/* TODO */
return
false
;
const
QString
line
=
in
.
readLine
().
trimmed
();
/* Dectect comment */
if
(
line
.
startsWith
(
";"
)
||
line
.
isEmpty
())
{
lineIndex
++
;
continue
;
}
/* Dectect sections */
else
if
(
line
.
startsWith
(
"["
)
&&
line
.
endsWith
(
"]"
))
{
currentSection
=
line
.
mid
(
1
,
line
.
size
()
-
2
);
qDebug
()
<<
"Parsing section"
<<
currentSection
;
if
(
!
validSections
.
contains
(
currentSection
))
{
qWarning
()
<<
"The current section"
<<
currentSection
<<
"is invalid, ignoring it"
;
currentSection
=
""
;
}
}
/* Other lines */
else
if
(
!
currentSection
.
isEmpty
())
{
const
int
separatorIndex
=
line
.
indexOf
(
": "
);
const
int
baseValueIndex
=
separatorIndex
+
2
;
if
(
separatorIndex
<
0
)
{
qWarning
()
<<
"Invalid line #"
<<
lineIndex
<<
":"
<<
line
;
}
assContent
[
currentSection
].
insert
(
line
.
mid
(
0
,
separatorIndex
),
line
.
mid
(
baseValueIndex
));
}
lineIndex
++
;
}
/* Construct the styles and the lines */
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/Ass/AssFactory.hh
+
1
−
0
Voir le fichier @
208d09e4
...
...
@@ -40,6 +40,7 @@ private:
static
inline
const
QString
sectionScriptInfo
=
"Script Info"
;
static
inline
const
QString
sectionStyles
=
"V4+ Styles"
;
static
inline
const
QString
sectionEvents
=
"Events"
;
static
inline
const
QStringList
validSections
=
{
sectionEvents
,
sectionScriptInfo
,
sectionStyles
};
static
inline
const
QStringList
intTypeFields
=
{
"PlayResX"
,
"PlayResY"
,
"WrapStyle"
};
static
inline
const
QList
<
QPair
<
QString
,
QString
>>
checkedValues
=
{
{
"ScriptType"
,
"v4.00+"
},
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter