SDK

Fonctions

int SPI_XML_open_xml_file (const std::string &dir, const std::string &name)
 Ouvre un fichier xml en lecture.
 
void SPI_XML_close_xml_file ()
 Ferme le fichier xml.
 
int SPI_XML_find_node (const std::string &nodeName)
 Recherche et sélectionne un noeud du fichier XML
Le noeud doit être unique dans le fichier.
 
int SPI_XML_select_node (const std::string &nodeName)
 Sélectionne un noeud du fichier XML (mode relatif)
 
int SPI_XML_select_next_node ()
 Sélectionne le noeud suivant de même nom.
 
int SPI_XML_select_parent_node ()
 Sélectionne le noeud parent du noeud courant.
 
int SPI_XML_select_root_node ()
 Sélectionne le noeud racine.
 
int SPI_XML_select_node_loop (const std::string &nodeName)
 Sélectionne un noeud (mode relatif) pour faire une boucle.
 
int SPI_XML_select_next_node_loop ()
 Sélectionne le noeud suivant de même nom dans la boucle.
 
int SPI_XML_get_current_string_attrib (const std::string &attribName, std::string &value)
 Lit la valeur chaîne de l'attribut.
 
int SPI_XML_get_current_real_attrib (const std::string &attribName, double *value)
 Lit la valeur réel de l'attribut.
 
int SPI_XML_get_current_integer_attrib (const std::string &attribName, int *value)
 Lit la valeur entière de l'attribut.
 
int SPI_XML_get_current_child (std::string &value)
 Lit la valeur contenue dans le noeud.
 
int SPI_XML_read_node_string (const std::string &nodeName, std::string &value)
 Lit la valeur chaîne d'un noeud.
 
int SPI_XML_read_node_real (const std::string &nodeName, double *value)
 Lit la valeur réelle d'un noeud.
 
int SPI_XML_read_node_integer (const std::string &nodeName, int *value)
 Lit la valeur entière d'un noeud.
 

Description détaillée

Lecture des fichiers XML

Documentation des fonctions

◆ SPI_XML_close_xml_file()

void SPI_XML_close_xml_file ( )

Ferme le fichier xml.

Version
5.13.206
void SPI_XML_close_xml_file()
Ferme le fichier xml.
Definition sp_xml01.c:132

◆ SPI_XML_find_node()

int SPI_XML_find_node ( const std::string & nodeName)

Recherche et sélectionne un noeud du fichier XML
Le noeud doit être unique dans le fichier.

Version
5.13.206
Paramètres
[in]nodeNamenom du noeud
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_find_node,'MyNode');
int SPI_XML_find_node(const std::string &nodeName)
Recherche et sélectionne un noeud du fichier XML Le noeud doit être unique dans le fichier.
Definition sp_xml01.c:153

◆ SPI_XML_get_current_child()

int SPI_XML_get_current_child ( std::string & value)

Lit la valeur contenue dans le noeud.

Version
5.13.206
Paramètres
[out]valuevaleur contenue dans le noeud
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_get_current_child,sVal);
int SPI_XML_get_current_child(std::string &value)
Lit la valeur contenue dans le noeud.
Definition sp_xml01.c:497

◆ SPI_XML_get_current_integer_attrib()

int SPI_XML_get_current_integer_attrib ( const std::string & attribName,
int * value )

Lit la valeur entière de l'attribut.

Version
5.13.206
Paramètres
[in]attribNamenom de l'attribut
[out]valuevaleur entière de l'attribut
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_get_current_integer_attrib,'MyString',iVal);
int SPI_XML_get_current_integer_attrib(const std::string &attribName, int *value)
Lit la valeur entière de l'attribut.
Definition sp_xml01.c:459

◆ SPI_XML_get_current_real_attrib()

int SPI_XML_get_current_real_attrib ( const std::string & attribName,
double * value )

Lit la valeur réel de l'attribut.

Version
5.13.206
Paramètres
[in]attribNamenom de l'attribut
[out]valuevaleur réelle de l'attribut
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_get_current_real_attrib,'MyString',rVal);
int SPI_XML_get_current_real_attrib(const std::string &attribName, double *value)
Lit la valeur réel de l'attribut.
Definition sp_xml01.c:421

◆ SPI_XML_get_current_string_attrib()

int SPI_XML_get_current_string_attrib ( const std::string & attribName,
std::string & value )

Lit la valeur chaîne de l'attribut.

Version
5.13.206
Paramètres
[in]attribNamenom de l'attribut
[out]valuevaleur chaîne de l'attribut
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_get_current_string_attrib,'MyString',sVal);
int SPI_XML_get_current_string_attrib(const std::string &attribName, std::string &value)
Lit la valeur chaîne de l'attribut.
Definition sp_xml01.c:383

◆ SPI_XML_open_xml_file()

int SPI_XML_open_xml_file ( const std::string & dir,
const std::string & name )

Ouvre un fichier xml en lecture.

Version
5.13.206
Paramètres
[in]dirrépertoire du fichier
[in]namenom du fichier
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ifile := ICALL(SPI_XML_open_xml_file,'c:\tmp','file');
int SPI_XML_open_xml_file(const std::string &dir, const std::string &name)
Ouvre un fichier xml en lecture.
Definition sp_xml01.c:59
Sub main()
NomFic = "fic_xml_courbes.xml"
RepFic = "v:\"
If (Go2cam.SPI_XML_open_xml_file(RepFic, NomFic) = SPI_YES) Then
If (Go2cam.SPI_XML_select_root_node() = SPI_YES) Then
If (Go2cam.SPI_XML_select_node("CadCurves") = SPI_YES) Then
If (Go2cam.SPI_XML_select_node("CurvesList") = SPI_YES) Then
If (Go2cam.SPI_XML_select_node_loop("Curve") = SPI_YES) Then
Do
If (Go2cam.SPI_XML_select_node("PointList") = SPI_YES) Then
If (Go2cam.SPI_XML_select_node_loop("Point") = SPI_YES) Then
Do
ier = Go2cam.SPI_XML_get_current_real_attrib("x", pt(0))
ier = Go2cam.SPI_XML_get_current_real_attrib("y", pt(1))
ier = Go2cam.SPI_XML_get_current_real_attrib("z", pt(2))
'do what you want with point coordinate
Loop While (Go2cam.SPI_XML_select_next_node_loop() = SPI_YES)
Call Go2cam.SPI_XML_select_parent_node 'Point
End If
Call Go2cam.SPI_XML_select_parent_node 'PointList
End If
Loop While (Go2cam.SPI_XML_select_next_node_loop() = SPI_YES)
Call Go2cam.SPI_XML_select_parent_node 'Curve
End If
Call Go2cam.SPI_XML_select_parent_node 'CurvesList
End If
Call Go2cam.SPI_XML_select_parent_node 'CadCurves
End If
End If
End If
End sub
int SPI_XML_select_node_loop(const std::string &nodeName)
Sélectionne un noeud (mode relatif) pour faire une boucle.
Definition sp_xml01.c:307
int SPI_XML_select_parent_node()
Sélectionne le noeud parent du noeud courant.
Definition sp_xml01.c:251
int SPI_XML_select_next_node_loop()
Sélectionne le noeud suivant de même nom dans la boucle.
Definition sp_xml01.c:355
int SPI_XML_select_root_node()
Sélectionne le noeud racine.
Definition sp_xml01.c:279
int SPI_XML_select_node(const std::string &nodeName)
Sélectionne un noeud du fichier XML (mode relatif)
Definition sp_xml01.c:189

◆ SPI_XML_read_node_integer()

int SPI_XML_read_node_integer ( const std::string & nodeName,
int * value )

Lit la valeur entière d'un noeud.

Version
5.13.206
Attention
Cette fonction ne sélectionne pas le noeud
Paramètres
[in]nodeNamenom du noeud
[out]valuevaleur entière du noeud
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_read_node_integer,'MyNode',rVal);
int SPI_XML_read_node_integer(const std::string &nodeName, int *value)
Lit la valeur entière d'un noeud.
Definition sp_xml01.c:615

◆ SPI_XML_read_node_real()

int SPI_XML_read_node_real ( const std::string & nodeName,
double * value )

Lit la valeur réelle d'un noeud.

Version
5.13.206
Attention
Cette fonction ne sélectionne pas le noeud
Paramètres
[in]nodeNamenom du noeud
[out]valuevaleur réelle du noeud
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_read_node_real,'MyNode',rVal);
int SPI_XML_read_node_real(const std::string &nodeName, double *value)
Lit la valeur réelle d'un noeud.
Definition sp_xml01.c:573

◆ SPI_XML_read_node_string()

int SPI_XML_read_node_string ( const std::string & nodeName,
std::string & value )

Lit la valeur chaîne d'un noeud.

Version
5.13.206
Attention
Cette fonction ne sélectionne pas le noeud
Paramètres
[in]nodeNamenom du noeud
[out]valuevaleur chaîne du noeud
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_read_node_string,'MyNode',sVal);
int SPI_XML_read_node_string(const std::string &nodeName, std::string &value)
Lit la valeur chaîne d'un noeud.
Definition sp_xml01.c:531

◆ SPI_XML_select_next_node()

int SPI_XML_select_next_node ( )

Sélectionne le noeud suivant de même nom.

Version
5.13.206
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_select_next_node);
int SPI_XML_select_next_node()
Sélectionne le noeud suivant de même nom.
Definition sp_xml01.c:223

◆ SPI_XML_select_next_node_loop()

int SPI_XML_select_next_node_loop ( )

Sélectionne le noeud suivant de même nom dans la boucle.

Version
5.13.206
Renvoie
SPI_YES si Ok | SPI_NO si erreur

◆ SPI_XML_select_node()

int SPI_XML_select_node ( const std::string & nodeName)

Sélectionne un noeud du fichier XML (mode relatif)

Version
5.13.206
Paramètres
[in]nodeNamenom du noeud
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_select_node,'MyNode');

◆ SPI_XML_select_node_loop()

int SPI_XML_select_node_loop ( const std::string & nodeName)

Sélectionne un noeud (mode relatif) pour faire une boucle.

Version
5.13.206
Paramètres
[in]nodeNamenom du noeud
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_select_node_loop,'MyNodeLoop');
VB6 example of a loop
If (Go2cam.SPI_XML_select_node("PointList") = SPI_YES) Then
If (Go2cam.SPI_XML_select_node_loop("Point") = SPI_YES) Then
Do
ier = Go2cam.SPI_XML_get_current_real_attrib("x", pt(0))
ier = Go2cam.SPI_XML_get_current_real_attrib("y", pt(1))
ier = Go2cam.SPI_XML_get_current_real_attrib("z", pt(2))
'do what you want with point coordinate
Loop While (Go2cam.SPI_XML_select_next_node_loop() = SPI_YES)
Call Go2cam.SPI_XML_select_parent_node 'Point
End If
Call Go2cam.SPI_XML_select_parent_node 'PointList
End If

◆ SPI_XML_select_parent_node()

int SPI_XML_select_parent_node ( )

Sélectionne le noeud parent du noeud courant.

Version
5.13.206
Renvoie
SPI_YES si Ok | SPI_NO si erreur

◆ SPI_XML_select_root_node()

int SPI_XML_select_root_node ( )

Sélectionne le noeud racine.

Version
5.13.206
Renvoie
SPI_YES si Ok | SPI_NO si erreur
ival := ICALL(SPI_XML_select_root_node);