Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
045a4fa6
Commit
045a4fa6
authored
Oct 03, 2017
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(DBInterface): remove deprecated functions
parent
de46f724
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
55 deletions
+34
-55
test.cc
extensions/DBServer-MySQL/test.cc
+1
-1
test.cc
extensions/DBServer-SQLite/test.cc
+1
-1
LogDB.cc
extensions/LogDB/LogDB.cc
+2
-2
DBInterface.h
include/DBInterface.h
+0
-21
DBInterface.cc
src/Services/DBInterface.cc
+30
-30
No files found.
extensions/DBServer-MySQL/test.cc
View file @
045a4fa6
...
@@ -55,7 +55,7 @@ int main(int argc, char** argv)
...
@@ -55,7 +55,7 @@ int main(int argc, char** argv)
cout
<<
endl
;
cout
<<
endl
;
cout
<<
"ID: "
<<
r
.
as_string
(
it
,
"id"
)
<<
endl
;
//
cout << "ID: " << r.as_string(it, "id") << endl;
cout
<<
"ID: "
<<
it
.
as_string
(
"id"
)
<<
endl
;
cout
<<
"ID: "
<<
it
.
as_string
(
"id"
)
<<
endl
;
}
}
...
...
extensions/DBServer-SQLite/test.cc
View file @
045a4fa6
...
@@ -42,7 +42,7 @@ int main(int argc, char** argv)
...
@@ -42,7 +42,7 @@ int main(int argc, char** argv)
// for( int i=0; i<col.size(); i++ )
// for( int i=0; i<col.size(); i++ )
// cerr << "[" << i << "]: " << r.getColName(i) << endl;
// cerr << "[" << i << "]: " << r.getColName(i) << endl;
cout
<<
"ID: "
<<
r
.
as_string
(
it
,
"id"
)
<<
endl
;
//
cout << "ID: " << r.as_string(it, "id") << endl;
cout
<<
"date: "
<<
it
.
as_string
(
"date"
)
<<
endl
;
cout
<<
"date: "
<<
it
.
as_string
(
"date"
)
<<
endl
;
}
}
...
...
extensions/LogDB/LogDB.cc
View file @
045a4fa6
...
@@ -392,7 +392,7 @@ size_t LogDB::getCountOfRecords( const std::string& logname )
...
@@ -392,7 +392,7 @@ size_t LogDB::getCountOfRecords( const std::string& logname )
if
(
!
ret
)
if
(
!
ret
)
return
0
;
return
0
;
return
(
size_t
)
DBResult
::
as_int
(
ret
.
begin
(),
0
);
return
(
size_t
)
ret
.
begin
().
as_int
(
0
);
}
}
//--------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------
size_t
LogDB
::
getFirstOfOldRecord
(
size_t
maxnum
)
size_t
LogDB
::
getFirstOfOldRecord
(
size_t
maxnum
)
...
@@ -405,7 +405,7 @@ size_t LogDB::getFirstOfOldRecord( size_t maxnum )
...
@@ -405,7 +405,7 @@ size_t LogDB::getFirstOfOldRecord( size_t maxnum )
if
(
!
ret
)
if
(
!
ret
)
return
0
;
return
0
;
return
(
size_t
)
DBResult
::
as_int
(
ret
.
begin
(),
0
);
return
(
size_t
)
ret
.
begin
().
as_int
(
0
);
}
}
//--------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------
std
::
shared_ptr
<
LogDB
>
LogDB
::
init_logdb
(
int
argc
,
const
char
*
const
*
argv
,
const
std
::
string
&
prefix
)
std
::
shared_ptr
<
LogDB
>
LogDB
::
init_logdb
(
int
argc
,
const
char
*
const
*
argv
,
const
std
::
string
&
prefix
)
...
...
include/DBInterface.h
View file @
045a4fa6
...
@@ -75,16 +75,6 @@ namespace uniset
...
@@ -75,16 +75,6 @@ namespace uniset
// slow function
// slow function
std
::
string
getColName
(
int
index
);
std
::
string
getColName
(
int
index
);
// ======================= DEPRECATED FUNCTIONS ===============================
// ROW
static
int
as_int
(
const
DBResult
::
iterator
&
it
,
int
col
);
static
double
as_double
(
const
DBResult
::
iterator
&
it
,
int
col
);
static
std
::
string
as_string
(
const
DBResult
::
iterator
&
it
,
int
col
);
int
as_int
(
const
DBResult
::
iterator
&
it
,
const
std
::
string
&
colname
);
double
as_double
(
const
DBResult
::
iterator
&
it
,
const
std
::
string
&
colname
);
std
::
string
as_string
(
const
DBResult
::
iterator
&
it
,
const
std
::
string
&
colname
);
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// COL
// COL
static
int
as_int
(
const
DBResult
::
COL
::
iterator
&
it
);
static
int
as_int
(
const
DBResult
::
COL
::
iterator
&
it
);
...
@@ -92,17 +82,6 @@ namespace uniset
...
@@ -92,17 +82,6 @@ namespace uniset
static
std
::
string
as_string
(
const
DBResult
::
COL
::
iterator
&
it
);
static
std
::
string
as_string
(
const
DBResult
::
COL
::
iterator
&
it
);
static
size_t
num_cols
(
const
DBResult
::
iterator
&
it
);
static
size_t
num_cols
(
const
DBResult
::
iterator
&
it
);
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// ===== END OF DEPRECATED FUNCTIONS =====
// ----------------------------------------------------------------------------
// USE NEW INTERFACE:
// ------------------
// for( auto it = dbres.begin(); it!= dbres.end(); ++it )
// cout << it.as_string("field_name") << endl;
// OR
// cout << it.as_string(index) << endl;
//
// available functions: as_string(), as_int(), as_double()
// ----------------------------------------------------------------------------
protected
:
protected
:
...
...
src/Services/DBInterface.cc
View file @
045a4fa6
...
@@ -79,36 +79,36 @@ namespace uniset
...
@@ -79,36 +79,36 @@ namespace uniset
return
row_
.
empty
();
return
row_
.
empty
();
}
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
int
DBResult
::
as_int
(
const
DBResult
::
iterator
&
it
,
int
col
)
//
int DBResult::as_int( const DBResult::iterator& it, int col )
{
//
{
return
it
.
as_int
(
col
);
//
return it.as_int(col);
}
//
}
// ----------------------------------------------------------------------------
//
//
----------------------------------------------------------------------------
double
DBResult
::
as_double
(
const
DBResult
::
iterator
&
it
,
int
col
)
//
double DBResult::as_double( const DBResult::iterator& it, int col )
{
//
{
return
it
.
as_double
(
col
);
//
return it.as_double(col);
}
//
}
// ----------------------------------------------------------------------------
//
//
----------------------------------------------------------------------------
std
::
string
DBResult
::
as_string
(
const
DBResult
::
iterator
&
it
,
int
col
)
//
std::string DBResult::as_string( const DBResult::iterator& it, int col )
{
//
{
return
it
.
as_string
(
col
);
//
return it.as_string(col);
}
//
}
int
DBResult
::
as_int
(
const
DBResult
::
iterator
&
it
,
const
std
::
string
&
cname
)
//
int DBResult::as_int( const DBResult::iterator& it, const std::string& cname )
{
//
{
return
it
.
as_int
(
cname
);
//
return it.as_int(cname);
}
//
}
double
DBResult
::
as_double
(
const
DBResult
::
iterator
&
it
,
const
std
::
string
&
cname
)
//
double DBResult::as_double(const DBResult::iterator& it, const std::string& cname)
{
//
{
return
it
.
as_double
(
cname
);
//
return it.as_double(cname);
}
//
}
std
::
string
DBResult
::
as_string
(
const
DBResult
::
iterator
&
it
,
const
std
::
string
&
cname
)
//
std::string DBResult::as_string( const DBResult::iterator& it, const std::string& cname )
{
//
{
return
it
.
as_string
(
cname
);
//
return it.as_string(cname);
}
//
}
// ----------------------------------------------------------------------------
//
//
----------------------------------------------------------------------------
size_t
DBResult
::
num_cols
(
const
DBResult
::
iterator
&
it
)
size_t
DBResult
::
num_cols
(
const
DBResult
::
iterator
&
it
)
{
{
return
it
.
num_cols
();
return
it
.
num_cols
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment