cmake添加windows编译, main 输入文件名调整, constexpr使用string_view
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#ifndef UTILTOOL_H
|
||||
#define UTILTOOL_H
|
||||
|
||||
#include <iostream>
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
enum class MediaType{
|
||||
VIDEO,
|
||||
@@ -14,9 +15,9 @@ enum class MediaType{
|
||||
class UtilTool
|
||||
{
|
||||
private:
|
||||
constexpr static std::array<std::string, 2> ImageTypes{"jpg","png"};
|
||||
constexpr static std::array<std::string, 1> VideoTypes{"mp4"};
|
||||
constexpr static std::array<std::string, 1> AudioTypes{"mp3"};
|
||||
constexpr static std::array<std::string_view, 2> ImageTypes{"jpg","png"};
|
||||
constexpr static std::array<std::string_view, 1> VideoTypes{"mp4"};
|
||||
constexpr static std::array<std::string_view, 1> AudioTypes{"mp3"};
|
||||
static bool CheckFileIsImage(const std::string& filename);
|
||||
static bool CheckFileIsAudio(const std::string& filename);
|
||||
static bool CheckFileIsVideo(const std::string& filename);
|
||||
|
||||
Reference in New Issue
Block a user