1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
int CSHA::get_rec_ov2 ( CFicRb& cfic, double& xd , double& yd, PCHAR& nom )
// cfic fichier ov2
// xd longitude
// yd latitude
// nom nom
// return 0 si eof sinon 2
{
for (;;)
{
unsigned char u = getc (cfic.m_pf);
if ( feof ( cfic.m_pf ) )return 0;
if ( u == 10 ) return 0;
if ( u == 0 ) // enregistrement delete
{
int nc = cfic.lit_int ();// lecture integer
cfic.saut_char (nc-5);// saut nc-5 caractères
continue;
}
else if ( u == 1 ) // enregistrement type 1
{
cfic.saut_char (20);
continue;
}
else if ( u == 2 ) // enregistrement type 2
{
int nc = cfic.lit_int ();
int xi = cfic.lit_int ();
int yi = cfic.lit_int ();
nom = cfic.lit_pchar (nc-13);lecture de nc-13 caractères
xd = xi;
yd = yi;
xd = xd * 1.e-5;
yd = yd * 1.e-5;
return 2;
}
else if ( u == 3 ) // enregistrement type 3
{
int nc = cfic.lit_int ();
int xi = cfic.lit_int ();
int yi = cfic.lit_int ();
nom = cfic.lit_pchar (nc-13);
JLER (u 3 à voir)// cas non encore rencontré
}
else
{
return 0;
}
}
} |
Partager