Organize code style

This commit is contained in:
an-tao 2019-01-21 22:25:20 +08:00
parent b20114a9d5
commit ef389b6ec9
11 changed files with 23 additions and 32 deletions

View File

@ -108,7 +108,7 @@ void create_model::createModelClassFromPG(const std::string &path, const DbClien
info._colType = "int32_t";
info._colLength = 4;
}
else if (type == "bigint" || type == "numeric") //FIXME:Use int64 to represent numeric type?
else if (type == "bigint" || type == "numeric") ///TODO:Use int64 to represent numeric type?
{
info._colType = "int64_t";
info._colLength = 8;
@ -149,7 +149,6 @@ void create_model::createModelClassFromPG(const std::string &path, const DbClien
else
{
info._colType = "std::string";
//FIXME add more type such as hstore...
}
auto defaultVal = row["column_default"].as<std::string>();

View File

@ -59,16 +59,14 @@ class HttpSimpleController : public DrObject<T>, public HttpSimpleControllerBase
{
T::___paths___();
}
protected:
///FIXME!!!
void _register(const std::string &className, const std::vector<std::string> &paths)
{
for (auto const &reqPath : paths)
{
std::cout << "register controller class " << className << " on path " << reqPath << std::endl;
}
}
// protected:
// void _register(const std::string &className, const std::vector<std::string> &paths)
// {
// for (auto const &reqPath : paths)
// {
// std::cout << "register controller class " << className << " on path " << reqPath << std::endl;
// }
// }
};
friend pathRegister;
static pathRegister _register;

View File

@ -77,14 +77,14 @@ class WebSocketController : public DrObject<T>, public WebSocketControllerBase
}
}
protected:
void _register(const std::string &className, const std::vector<std::string> &paths)
{
for (auto const &reqPath : paths)
{
std::cout << "register controller class " << className << " on path " << reqPath << std::endl;
}
}
// protected:
// void _register(const std::string &className, const std::vector<std::string> &paths)
// {
// for (auto const &reqPath : paths)
// {
// std::cout << "register controller class " << className << " on path " << reqPath << std::endl;
// }
// }
};
friend pathRegister;
static pathRegister _register;

View File

@ -810,7 +810,7 @@ void HttpAppFrameworkImpl::readSendFile(const std::string &filePath, const HttpR
if (_useSendfile &&
filesize > 1024 * 200)
//FIXME : Is 200k an appropriate value? Or set it to be configurable
//TODO : Is 200k an appropriate value? Or set it to be configurable
{
//The advantages of sendfile() can only be reflected in sending large files.
std::dynamic_pointer_cast<HttpResponseImpl>(resp)->setSendfile(filePath);

View File

@ -150,7 +150,7 @@ void HttpControllersRouter::route(const HttpRequestImplPtr &req,
{
for (size_t i = 1; i < result.size(); i++)
{
//FIXME:Is there any better way to find the sub-match index without using loop?
//TODO: Is there any better way to find the sub-match index without using loop?
if (!result[i].matched)
continue;
if (result[i].str() == req->path() && i <= _ctrlVector.size())

View File

@ -373,7 +373,6 @@ class HttpResponseImpl : public HttpResponse
std::unordered_map<std::string, Cookie> _cookies;
HttpStatusCode _statusCode;
trantor::Date _createDate;
// FIXME: add http version
Version _v;
std::string _statusMessage;
bool _closeConnection;

View File

@ -117,7 +117,7 @@ void SharedLibManager::managerLibs()
cmd.append(filename).append(" -o ").append(libPath);
LOG_TRACE << cmd;
auto r = system(cmd.c_str());
//FIXME:handle r
//TODO:handle r
(void)(r);
auto srcFile = filename.substr(0, pos);
srcFile.append(".cc");

View File

@ -1078,7 +1078,6 @@ inline Mapper<T> &Mapper<T>::forUpdate()
template <typename T>
inline std::string Mapper<T>::replaceSqlPlaceHolder(const std::string &sqlStr, const std::string &holderStr) const
{
///FIXME add mysql support
if (_client->type() == ClientType::PostgreSQL)
{
std::string::size_type startPos = 0;

View File

@ -126,7 +126,6 @@ void MysqlConnection::setChannel()
if (_channelPtr->isWriting())
_channelPtr->disableWriting();
}
//(status & MYSQL_WAIT_EXCEPT) ///FIXME
if (_waitStatus & MYSQL_WAIT_TIMEOUT)
{
auto timeout = mysql_get_timeout_value(_mysqlPtr.get());
@ -242,7 +241,6 @@ void MysqlConnection::handleEvent()
{
_execStatus = ExecStatus_None;
outputError();
//FIXME exception callback;
return;
}
_execStatus = ExecStatus_StoreResult;
@ -255,7 +253,6 @@ void MysqlConnection::handleEvent()
if (err)
{
outputError();
//FIXME exception callback;
return;
}
getResult(ret);
@ -275,7 +272,6 @@ void MysqlConnection::handleEvent()
{
_execStatus = ExecStatus_None;
outputError();
//FIXME exception callback;
return;
}
getResult(ret);
@ -423,7 +419,7 @@ void MysqlConnection::outputError()
try
{
//FIXME exception type
//TODO exception type
throw SqlError(mysql_error(_mysqlPtr.get()),
_sql);
}

View File

@ -238,7 +238,7 @@ void PgConnection::handleRead()
{
try
{
//FIXME exception type
//TODO exception type
throw SqlError(PQerrorMessage(_connPtr.get()),
_sql);
}

@ -1 +1 @@
Subproject commit fd0920b8b63f22decdf029d7e612f3170df68908
Subproject commit aca0bec46a1ae85a059a7af7bc9d705a00e1c789