配置键名统一使用string

This commit is contained in:
xiongziliang 2019-06-19 10:32:54 +08:00
parent 446c0feb6e
commit e1e50191fb
3 changed files with 19 additions and 14 deletions

View File

@ -27,16 +27,21 @@
#ifndef ZLMEDIAKIT_WEBAPI_H #ifndef ZLMEDIAKIT_WEBAPI_H
#define ZLMEDIAKIT_WEBAPI_H #define ZLMEDIAKIT_WEBAPI_H
#include <string>
using namespace std;
namespace mediakit { namespace mediakit {
////////////RTSP服务器配置/////////// ////////////RTSP服务器配置///////////
namespace Rtsp { namespace Rtsp {
extern const char kPort[]; extern const string kPort;
} //namespace Rtsp } //namespace Rtsp
////////////RTMP服务器配置/////////// ////////////RTMP服务器配置///////////
namespace Rtmp { namespace Rtmp {
extern const char kPort[]; extern const string kPort;
} //namespace RTMP } //namespace RTMP
} // namespace mediakit } // namespace mediakit

View File

@ -58,9 +58,9 @@ namespace mediakit {
namespace Http { namespace Http {
#define HTTP_FIELD "http." #define HTTP_FIELD "http."
#define HTTP_PORT 80 #define HTTP_PORT 80
const char kPort[] = HTTP_FIELD"port"; const string kPort = HTTP_FIELD"port";
#define HTTPS_PORT 443 #define HTTPS_PORT 443
const char kSSLPort[] = HTTP_FIELD"sslport"; const string kSSLPort = HTTP_FIELD"sslport";
onceToken token1([](){ onceToken token1([](){
mINI::Instance()[kPort] = HTTP_PORT; mINI::Instance()[kPort] = HTTP_PORT;
mINI::Instance()[kSSLPort] = HTTPS_PORT; mINI::Instance()[kSSLPort] = HTTPS_PORT;
@ -71,7 +71,7 @@ onceToken token1([](){
namespace Shell { namespace Shell {
#define SHELL_FIELD "shell." #define SHELL_FIELD "shell."
#define SHELL_PORT 9000 #define SHELL_PORT 9000
const char kPort[] = SHELL_FIELD"port"; const string kPort = SHELL_FIELD"port";
onceToken token1([](){ onceToken token1([](){
mINI::Instance()[kPort] = SHELL_PORT; mINI::Instance()[kPort] = SHELL_PORT;
},nullptr); },nullptr);
@ -82,8 +82,8 @@ namespace Rtsp {
#define RTSP_FIELD "rtsp." #define RTSP_FIELD "rtsp."
#define RTSP_PORT 554 #define RTSP_PORT 554
#define RTSPS_PORT 322 #define RTSPS_PORT 322
const char kPort[] = RTSP_FIELD"port"; const string kPort = RTSP_FIELD"port";
const char kSSLPort[] = RTSP_FIELD"sslport"; const string kSSLPort = RTSP_FIELD"sslport";
onceToken token1([](){ onceToken token1([](){
mINI::Instance()[kPort] = RTSP_PORT; mINI::Instance()[kPort] = RTSP_PORT;
mINI::Instance()[kSSLPort] = RTSPS_PORT; mINI::Instance()[kSSLPort] = RTSPS_PORT;
@ -95,7 +95,7 @@ onceToken token1([](){
namespace Rtmp { namespace Rtmp {
#define RTMP_FIELD "rtmp." #define RTMP_FIELD "rtmp."
#define RTMP_PORT 1935 #define RTMP_PORT 1935
const char kPort[] = RTMP_FIELD"port"; const string kPort = RTMP_FIELD"port";
onceToken token1([](){ onceToken token1([](){
mINI::Instance()[kPort] = RTMP_PORT; mINI::Instance()[kPort] = RTMP_PORT;
},nullptr); },nullptr);

View File

@ -54,9 +54,9 @@ namespace mediakit {
namespace Http { namespace Http {
#define HTTP_FIELD "http." #define HTTP_FIELD "http."
#define HTTP_PORT 80 #define HTTP_PORT 80
const char kPort[] = HTTP_FIELD"port"; const string kPort = HTTP_FIELD"port";
#define HTTPS_PORT 443 #define HTTPS_PORT 443
const char kSSLPort[] = HTTP_FIELD"sslport"; const string kSSLPort = HTTP_FIELD"sslport";
onceToken token1([](){ onceToken token1([](){
mINI::Instance()[kPort] = HTTP_PORT; mINI::Instance()[kPort] = HTTP_PORT;
mINI::Instance()[kSSLPort] = HTTPS_PORT; mINI::Instance()[kSSLPort] = HTTPS_PORT;
@ -67,7 +67,7 @@ onceToken token1([](){
namespace Shell { namespace Shell {
#define SHELL_FIELD "shell." #define SHELL_FIELD "shell."
#define SHELL_PORT 9000 #define SHELL_PORT 9000
const char kPort[] = SHELL_FIELD"port"; const string kPort = SHELL_FIELD"port";
onceToken token1([](){ onceToken token1([](){
mINI::Instance()[kPort] = SHELL_PORT; mINI::Instance()[kPort] = SHELL_PORT;
},nullptr); },nullptr);
@ -78,8 +78,8 @@ namespace Rtsp {
#define RTSP_FIELD "rtsp." #define RTSP_FIELD "rtsp."
#define RTSP_PORT 554 #define RTSP_PORT 554
#define RTSPS_PORT 322 #define RTSPS_PORT 322
const char kPort[] = RTSP_FIELD"port"; const string kPort = RTSP_FIELD"port";
const char kSSLPort[] = RTSP_FIELD"sslport"; const string kSSLPort = RTSP_FIELD"sslport";
onceToken token1([](){ onceToken token1([](){
mINI::Instance()[kPort] = RTSP_PORT; mINI::Instance()[kPort] = RTSP_PORT;
mINI::Instance()[kSSLPort] = RTSPS_PORT; mINI::Instance()[kSSLPort] = RTSPS_PORT;
@ -91,7 +91,7 @@ onceToken token1([](){
namespace Rtmp { namespace Rtmp {
#define RTMP_FIELD "rtmp." #define RTMP_FIELD "rtmp."
#define RTMP_PORT 1935 #define RTMP_PORT 1935
const char kPort[] = RTMP_FIELD"port"; const string kPort = RTMP_FIELD"port";
onceToken token1([](){ onceToken token1([](){
mINI::Instance()[kPort] = RTMP_PORT; mINI::Instance()[kPort] = RTMP_PORT;
},nullptr); },nullptr);