配置键名统一使用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
#define ZLMEDIAKIT_WEBAPI_H
#include <string>
using namespace std;
namespace mediakit {
////////////RTSP服务器配置///////////
namespace Rtsp {
extern const char kPort[];
extern const string kPort;
} //namespace Rtsp
////////////RTMP服务器配置///////////
namespace Rtmp {
extern const char kPort[];
extern const string kPort;
} //namespace RTMP
} // namespace mediakit

View File

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

View File

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