clean: delete stub_msvc.h

This commit is contained in:
shenleban tongying 2024-11-20 03:57:36 -05:00
parent 112874b0e3
commit 8b0f06f715
18 changed files with 26 additions and 82 deletions

View file

@ -4,9 +4,7 @@
#include <QStyle>
#include <QMessageBox>
#include <string>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include <QBuffer>
#include <QTextCodec>
@ -31,10 +29,9 @@ std::string c_string( const QString & str )
return std::string( str.toUtf8().constData() );
}
bool endsWithIgnoreCase( const string & str1, string str2 )
{
return ( str1.size() >= (unsigned)str2.size() )
&& ( strcasecmp( str1.c_str() + ( str1.size() - str2.size() ), str2.data() ) == 0 );
bool endsWithIgnoreCase( QByteArrayView str, QByteArrayView extension )
{
return str.endsWith( extension );
}
QString escapeAmps( QString const & str )

View file

@ -40,7 +40,7 @@ inline QString rstrip( const QString & str )
}
std::string c_string( const QString & str );
bool endsWithIgnoreCase( const string & str1, string str2 );
bool endsWithIgnoreCase( QByteArrayView str, QByteArrayView extension );
/**
* remove punctuation , space, symbol
*

View file

@ -16,9 +16,6 @@
#include <set>
#include <string>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include <QString>
#include <QSemaphore>

View file

@ -22,9 +22,6 @@
#include <string.h>
#include <zlib.h>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include <QAtomicInt>
#include <QPainter>

View file

@ -23,10 +23,6 @@
#include <QRegularExpression>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
namespace DictdFiles {
using std::map;

View file

@ -27,10 +27,6 @@
#include <list>
#include <wctype.h>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include <QSemaphore>
#include <QThreadPool>
#include <QAtomicInt>
@ -1740,12 +1736,16 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
// Make sure it's not an abbreviation file
int extSize = ( uncompressedDsl ? 4 : 7 );
if ( fileName.size() - extSize >= 5
&& strncasecmp( fileName.c_str() + fileName.size() - extSize - 5, "_abrv", 5 ) == 0 ) {
// It is, skip it
continue;
if ( fileName.size() - extSize >= 5){
auto fileName_without_extension = QByteArrayView( fileName ).chopped(extSize);
if ( fileName_without_extension.endsWith( "_abrv" ) ) {
// It is, skip it
continue;
}
}
unsigned atLine = 0; // Indicates current line in .dsl, for debug purposes
try {

View file

@ -1,5 +1,8 @@
#pragma once
#include "dict/dictionary.hh"
#include "ex.hh"
@ -18,8 +21,12 @@
#include <QString>
#include <QtCore5Compat/QTextCodec>
#ifdef _MSC_VER
#include <stub_msvc.h>
// POSIX symbol unavailable on Windows needed for eb headers
#ifdef Q_OS_WIN
#ifndef _SSIZE_T
#define _SSIZE_T
#define ssize_t long
#endif
#endif
#include <eb/eb.h>

View file

@ -39,9 +39,6 @@
#include <map>
#include <set>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
namespace Gls {

View file

@ -14,10 +14,6 @@
#include <set>
#include <string>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#define OV_EXCLUDE_STATIC_CALLBACKS
#include <vorbis/vorbisfile.h>
#include <QDir>

View file

@ -23,9 +23,6 @@
#include <map>
#include <set>
#include <list>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include "globalregex.hh"
#include "tiff.hh"

View file

@ -19,13 +19,8 @@
#include <set>
#include <string>
#include "utils.hh"
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
namespace Sdict {
using std::map;

View file

@ -17,10 +17,6 @@
#include "tiff.hh"
#include "utils.hh"
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include "iconv.hh"
#include <QString>

View file

@ -30,9 +30,6 @@
#endif
#include <stdlib.h>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include <QString>
#include <QSemaphore>

View file

@ -27,9 +27,6 @@
#include "tiff.hh"
#include "ftshelpers.hh"
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include <QIODevice>
#include <QXmlStreamReader>

View file

@ -17,10 +17,6 @@
#include "ftshelpers.hh"
#include "htmlescape.hh"
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include <QByteArray>
#include <QFile>
#include <QString>

View file

@ -19,9 +19,6 @@
#include <QFile>
#include <QDir>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include "utils.hh"

View file

@ -9,9 +9,7 @@
#include <QLocale>
#include <QRegularExpression>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
// Language codes
QMap< QString, GDLangCode > LangCoder::LANG_CODE_MAP = {
@ -231,10 +229,11 @@ QString LangCoder::intToCode2( quint32 val )
quint32 LangCoder::findIdForLanguage( gd::wstring const & lang )
{
const auto langFolded = Utf8::encode( lang );
const auto langFolded = QByteArrayView( Utf8::encode( lang ) );
for ( auto const & lc : LANG_CODE_MAP ) {
if ( strcasecmp( langFolded.c_str(), lc.lang.c_str() ) == 0 ) {
if ( langFolded.compare( lc.lang, Qt::CaseInsensitive ) )
{
return code2toInt( lc.code2.toStdString().c_str() );
}
}

View file

@ -1,17 +0,0 @@
#pragma once
#include <string>
#ifdef _MSC_VER
#if !defined(strcasecmp)
# define strcasecmp _strcmpi
#endif
#if !defined(strncasecmp)
# define strncasecmp _strnicmp
#endif
#ifndef _SSIZE_T
#define _SSIZE_T
#define ssize_t long
#endif
#endif