mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 17:56:13 -04:00
Renamed Column::getName() to Column::getOriginName()
This commit is contained in:
parent
ef6fac6b71
commit
05a37fd64c
@ -30,4 +30,8 @@ Version 0.5.0 - March 9 2013
|
||||
Added bind() for binary blob data
|
||||
|
||||
Version 0.5.1 - April 7 2013
|
||||
Added getName()
|
||||
Added Collumn::getName()
|
||||
|
||||
TODO 0.6.0 - ?? 2013
|
||||
Renamed Collumn::getName() to Collumn::getOriginName()
|
||||
|
||||
|
@ -27,7 +27,7 @@ if (MSVC)
|
||||
add_definitions (/D_CRT_SECURE_NO_WARNINGS)
|
||||
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
# GCC flags
|
||||
add_definitions (-rdynamic -fstack-protector-all -Wall -Wextra -pedantic -Weffc++ -Wformat-security -Winit-self -Wswitch-default -Wswitch-enum -Wfloat-equal -Wundef -Wshadow -Wcast-qual -Wconversion -Wlogical-op -Winline -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn)
|
||||
add_definitions (-rdynamic -fstack-protector-all -Wall -Wextra -pedantic -Weffc++ -Wformat-security -Winit-self -Wswitch-default -Wswitch-enum -Wfloat-equal -Wundef -Wshadow -Wcast-qual -Wconversion -Wlogical-op -Winline -Wsuggest-attribute=pure -Wsuggest-attribute=const)
|
||||
endif ()
|
||||
|
||||
# add a cppcheck target to the "all" target
|
||||
|
@ -113,11 +113,12 @@ int main (void)
|
||||
static bool bFirst = true;
|
||||
if (bFirst)
|
||||
{
|
||||
// Show how to get the name of a column.
|
||||
// Requires the SQLITE_ENABLE_COLUMN_METADATA preprocessor macro to be also defined at compile times of the SQLite library.
|
||||
std::string name0 = query.getColumn(0).getName();
|
||||
std::string name1 = query.getColumn(1).getName();
|
||||
std::string name2 = query.getColumn(2).getName();
|
||||
// Show how to get the name of the table column from which this particular result column come from.
|
||||
// Requires the SQLITE_ENABLE_COLUMN_METADATA preprocessor macro to be
|
||||
// also defined at compile times of the SQLite library itself.
|
||||
std::string name0 = query.getColumn(0).getOriginName();
|
||||
std::string name1 = query.getColumn(1).getOriginName();
|
||||
std::string name2 = query.getColumn(2).getOriginName();
|
||||
std::cout << "table 'test' [\"" << name0.c_str() << "\", \"" << name1.c_str() << "\", \"" << name2.c_str() << "\"]\n";
|
||||
bFirst = false;
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ Column::~Column(void) throw() // nothrow
|
||||
}
|
||||
|
||||
#ifdef SQLITE_ENABLE_COLUMN_METADATA
|
||||
// Return the name of the column
|
||||
const char * Column::getName(void) const throw() // nothrow
|
||||
// Return the name of the table column that is the origin of this result column
|
||||
const char * Column::getOriginName(void) const throw() // nothrow
|
||||
{
|
||||
return sqlite3_column_origin_name(mStmtPtr, mIndex);
|
||||
}
|
||||
|
@ -53,13 +53,13 @@ public:
|
||||
|
||||
#ifdef SQLITE_ENABLE_COLUMN_METADATA
|
||||
/**
|
||||
* @brief Return a pointer to the column name
|
||||
* @brief Return a pointer to the table column name that is the origin of this result column
|
||||
*
|
||||
* Require definition of the SQLITE_ENABLE_COLUMN_METADATA preprocessor macro :
|
||||
* - for compilation of the SQLite library,
|
||||
* - when building the SQLite library itself (which is the case for the Debian libsqlite3 binary for instance),
|
||||
* - and also when compiling this wrapper.
|
||||
*/
|
||||
const char* getName (void) const throw(); // nothrow
|
||||
const char* getOriginName (void) const throw(); // nothrow
|
||||
#endif
|
||||
|
||||
/// @brief Return the integer value of the column.
|
||||
|
Loading…
x
Reference in New Issue
Block a user