mirror of
https://github.com/zoriya/xmlParser.git
synced 2026-05-23 22:52:29 +00:00
Coding style
This commit is contained in:
+8
-5
@@ -1,11 +1,14 @@
|
||||
//
|
||||
// Created by anonymus-raccoon on 3/2/20.
|
||||
//
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** My3D
|
||||
** File description:
|
||||
** otherget
|
||||
*/
|
||||
|
||||
#include "xml.h"
|
||||
|
||||
char *xml_gettmpstring(node *n, const char *key, char *def)
|
||||
{
|
||||
char *ret = xml_gettempprop(n, key);
|
||||
return ret ? ret : def;
|
||||
char *ret = xml_gettempprop(n, key);
|
||||
return ret ? ret : def;
|
||||
}
|
||||
+12
-12
@@ -42,22 +42,22 @@ bool xml_hasproperty(node *n, const char *key)
|
||||
|
||||
bool xml_propcontains(node *n, const char *key, const char *tofind)
|
||||
{
|
||||
char *tmp = xml_gettempprop(n, key);
|
||||
char *tmp = xml_gettempprop(n, key);
|
||||
|
||||
return tmp && my_strstr(tmp, tofind);
|
||||
return tmp && my_strstr(tmp, tofind);
|
||||
}
|
||||
|
||||
bool xml_getbool(node *n, const char *key, bool default_value)
|
||||
{
|
||||
char *tmp = xml_gettempprop(n, key);
|
||||
char *tmp = xml_gettempprop(n, key);
|
||||
|
||||
if (tmp && !my_strcmp(tmp, "true"))
|
||||
return (true);
|
||||
if (tmp && !my_strcmp(tmp, "True"))
|
||||
return (true);
|
||||
if (tmp && !my_strcmp(tmp, "false"))
|
||||
return (false);
|
||||
if (tmp && !my_strcmp(tmp, "False"))
|
||||
return (false);
|
||||
return (default_value);
|
||||
if (tmp && !my_strcmp(tmp, "true"))
|
||||
return (true);
|
||||
if (tmp && !my_strcmp(tmp, "True"))
|
||||
return (true);
|
||||
if (tmp && !my_strcmp(tmp, "false"))
|
||||
return (false);
|
||||
if (tmp && !my_strcmp(tmp, "False"))
|
||||
return (false);
|
||||
return (default_value);
|
||||
}
|
||||
+3
-3
@@ -28,9 +28,9 @@ char *xml_getproperty(node *n, const char *key)
|
||||
char *prop = xml_gettempprop(n, key);
|
||||
|
||||
if (prop) {
|
||||
my_str_replace(prop, "\\n", '\n');
|
||||
return (my_strdup(prop));
|
||||
}
|
||||
my_str_replace(prop, "\\n", '\n');
|
||||
return (my_strdup(prop));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user