Skip to content

enum 先行宣言 (ECodeType) #2026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions sakura_core/charset/charset.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

// 文字コードセット種別
//2007.08.14 kobake CODE_ERROR, CODE_DEFAULT 追加
enum ECodeType {
enum ECodeType : int {
CODE_SJIS, //!< SJIS (MS-CP932(Windows-31J), シフトJIS(Shift_JIS))
CODE_JIS, //!< JIS (MS-CP5022x(ISO-2022-JP-MS)ではない)
CODE_EUC, //!< EUC (MS-CP51932, eucJP-ms(eucJP-open)ではない)
Expand Down Expand Up @@ -84,19 +84,6 @@ inline bool IsValidCodeTypeExceptSJIS(int code)
return IsValidCodeType(code) && code!=CODE_SJIS;
}

// 2010/6/21 Uchi 削除
//2007.08.14 kobake 追加
//!ECodeType型で表せる値ならtrue
//inline bool IsInECodeType(int code)
//{
// return (code>=0 && code<CODE_CODEMAX) || code==CODE_ERROR || code==CODE_AUTODETECT;
//}

// 2010/6/21 Uchi 削除
//inline bool IsConcreteCodeType(ECodeType eCodeType)
//{
// return IsValidCodeType(eCodeType) && eCodeType != CODE_AUTODETECT;
//}
inline bool IsValidCodePageEx(int code)
{
return 12000 == code
Expand Down
35 changes: 0 additions & 35 deletions sakura_core/charset/codechecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,41 +40,6 @@
#include "convert/convert_util2.h"
#include "basis/primitive.h"

/*!
認識する文字コード種別
*/
//enum ECodeType; charset/charset.h に定義されている
#if 0
enum ECodeType {
CODE_SJIS, // MS-CP932(Windows-31J), シフトJIS(Shift_JIS)
CODE_JIS, // MS-CP5022x(ISO-2022-JP-MS)
CODE_EUC, // MS-CP51932, eucJP-ms(eucJP-open)
CODE_UNICODE, // UTF-16 LittleEndian(UCS-2)
CODE_UTF8, // UTF-8(UCS-2)
CODE_UTF7, // UTF-7(UCS-2)
CODE_UNICODEBE, // UTF-16 BigEndian(UCS-2)
// ...
CODE_CODEMAX,
CODE_AUTODETECT = 99, /* 文字コード自動判別 */
CODE_DEFAULT = CODE_SJIS, /* デフォルトの文字コード */

/*
- MS-CP50220
Unicode から cp50220 への変換時に、
JIS X 0201 片仮名は JIS X 0208 の片仮名に置換される
- MS-CP50221
Unicode から cp50221 への変換時に、
JIS X 0201 片仮名は、G0 集合への指示のエスケープシーケンス ESC ( I を用いてエンコードされる
- MS-CP50222
Unicode から cp50222 への変換時に、
JIS X 0201 片仮名は、SO/SI を用いてエンコードされる

参考
http://legacy-encoding.sourceforge.jp/wiki/
*/
};
#endif

/*!
内部的に認識する文字集合
*/
Expand Down
1 change: 1 addition & 0 deletions sakura_core/dlg/CDlgOpenFile_CommonFileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "CFileExt.h"
#include "env/CDocTypeManager.h"
#include "env/CShareData.h"
#include "env/DLLSHAREDATA.h"
#include "CEditApp.h"
#include "CEol.h"
#include "charset/CCodePage.h"
Expand Down
2 changes: 1 addition & 1 deletion sakura_core/dlg/CDlgSetCharSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "dlg/CDialog.h"

enum ECodeType;
enum ECodeType : int;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

主題「前方宣言しないと怒られる」の対策は以下で解決できそうに思います。

Suggested change
enum ECodeType : int;
#include "charset/charset.h"

主題以外の修正が多いですが、「ダメ」でない気はしてます。


//! 文字コードセット設定ダイアログボックス
class CDlgSetCharSet final : public CDialog
Expand Down
2 changes: 2 additions & 0 deletions sakura_core/parse/DetectIndentationStyle.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

class CEditDoc;

struct IndentationStyle
{
enum class Character {
Expand Down