-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDateinamensteile_Bestimmen.cpp
66 lines (59 loc) · 2 KB
/
Dateinamensteile_Bestimmen.cpp
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
60
61
62
63
64
65
66
/*
* Dateinamensteile_Bestimmen.cpp
*
* Copyright (c) 2011-2017 Stefan Bender
* Copyright (c) 2010-2011 Martin Langowski
*
* Initial version created on: 23.09.2010
* Author: Martin Langowski
*
* This file is part of scia_retrieval_2d
*
* scia_retrieval_2d is free software: you can redistribute it or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2.
* See accompanying COPYING.GPL2 file or http://www.gnu.org/licenses/gpl-2.0.html.
*/
#include<string>
std::string sb_basename(std::string filename)
{
std::string bname = filename;
std::string::size_type pos = filename.find_last_of("/\\");
if (pos != std::string::npos)
bname = filename.substr(pos + 1);
return bname;
}
////////////////////////////////////////////////////
// Funktionsstart xxxxx_Bestimmen
////////////////////////////////////////////////////
std::string xxxxx_Bestimmen(std::string Orbitlistenpfad)
{
std::string bname = sb_basename(Orbitlistenpfad);
std::string::size_type pos = bname.find_first_of("0123456789");
if (pos != std::string::npos)
return bname.substr(pos, 5);
else
return "xxxxx";
}
////////////////////////////////////////////////////
// ENDE xxxxx_Bestimmen
////////////////////////////////////////////////////
////////////////////////////////////////////////////
// Funktionsstart yyyymmdd_hhmm
////////////////////////////////////////////////////
std::string yyyymmdd_hhmm_Bestimmen(std::string Name_erste_Limbdatei)
{
// Die Datei ist im MPL_binary Format
// z.b. SCIA_limb_20040111_084344_1_0_09752.dat.l_mpl_binary
std::string bname = sb_basename(Name_erste_Limbdatei);
std::string::size_type pos = bname.find_first_of("0123456789");
//TODO Das eventuell ganz umbennnen...
// suchen eigentlich nur Datum...Uhrzeit Wuascht
if (pos != std::string::npos)
return bname.substr(pos, 8);
else
return "yyyymmdd";
}
////////////////////////////////////////////////////
// ENDE yyyymmdd_hhmm
////////////////////////////////////////////////////