Skip to content

Commit

Permalink
supporting ios and can be compiled by xcode.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengshuxin committed Mar 12, 2017
1 parent a176d4a commit 3cd0864
Show file tree
Hide file tree
Showing 86 changed files with 4,818 additions and 426 deletions.
13 changes: 13 additions & 0 deletions acl.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions app/jencode/Gb2Utf8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ void CGb2Utf8::OnTransEnd(int nMsg)
int CGb2Utf8::TransformPath(CString *path_from, CString *path_to)
{
ACL_SCAN_DIR *scan_src; //, *scan_dst;
const char *path = path_from->GetString();

scan_src = acl_scan_dir_open(path_from->GetString(), 1);
scan_src = acl_scan_dir_open(path, 1);
if (scan_src == NULL) {
CString msg;

Expand Down Expand Up @@ -97,18 +98,27 @@ int CGb2Utf8::TransformFile(const char *pFrom, const char *pTo)
if (conv.convert(m_fromCharset.GetString(), m_toCharset.GetString(),
sBuf, iLen, &buf) == false)
{
logger_error("conver from %s to %s error: %s",
logger_error("conver from %s to %s error: %s, file: %s",
m_fromCharset.GetString(), m_toCharset.GetString(),
conv.serror());
conv.serror(), pFrom);
RETURN (-1);
}

ACL_VSTREAM *fp;
fp = acl_vstream_fopen(pFrom, O_RDWR | O_TRUNC | O_BINARY | O_APPEND, 0600, 1024);
fp = acl_vstream_fopen(pFrom, O_RDWR | O_TRUNC | O_BINARY /* | O_APPEND */,
0600, 1024);
if (fp == NULL)
{
logger_error("open %s error %s", pFrom, acl::last_serror());
RETURN (-1);
}
int ret = acl_vstream_writen(fp, buf.c_str(), buf.length());
acl_vstream_close(fp);
if (ret == ACL_VSTREAM_EOF)
logger_error("write to %s error %s", pFrom, acl::last_serror());
else
logger("transer from %s to %s ok, file: %s",
m_fromCharset.GetString(), m_toCharset.GetString(), pFrom);
RETURN (ret == ACL_VSTREAM_EOF ? -1 : 0);
}

Expand Down
20 changes: 8 additions & 12 deletions app/jencode/Jencode.rc
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// ����(�л����񹲺͹�) resources
// ����(���壬�й�) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
#ifdef _WIN32
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
#pragma code_page(936)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -72,8 +70,7 @@ IDR_MAINFRAME ICON "res\\Jencode.ico"
//

IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "���� Jencode"
FONT 9, "MS Shell Dlg", 0, 0, 0x1
BEGIN
Expand All @@ -84,8 +81,7 @@ BEGIN
END

IDD_JENCODE_DIALOG DIALOGEX 0, 0, 319, 189
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP |
WS_VISIBLE | WS_CAPTION | WS_SYSMENU
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Jencode"
FONT 9, "MS Shell Dlg", 0, 0, 0x1
Expand All @@ -101,10 +97,10 @@ BEGIN
PUSHBUTTON "���...",IDC_IDX_SELECT,236,118,31,14
GROUPBOX "�ļ�ת��",IDC_STATIC,17,19,269,84
PUSHBUTTON "����ת��",IDC_TRANS_IDX,29,119,37,13
LTEXT "ע�⣺��ת����Դ�ļ����ݽ��ᱻ�ı䣬����ǿ�ҽ�����ת��ǰ�ȱ���Դ�ļ�!",
IDC_STATIC,24,31,256,8
LTEXT "ע�⣺��ת����Դ�ļ����ݽ��ᱻ�ı䣬����ǿ�ҽ�����ת��ǰ�ȱ���Դ�ļ�!",IDC_STATIC,24,31,256,8
PUSHBUTTON "ȥ��BOM",IDC_DEL_BOM,69,82,50,14
PUSHBUTTON "UTF8ת����GB",IDC_BUTTON_UTF2GB,123,66,50,14
PUSHBUTTON "GBתUNICODE",IDC_BUTTON_GB2UNI,177,66,50,14
END


Expand Down Expand Up @@ -153,7 +149,7 @@ END
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
GUIDELINES DESIGNINFO
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
Expand All @@ -179,12 +175,12 @@ END
// String Table
//

STRINGTABLE
STRINGTABLE
BEGIN
IDS_ABOUTBOX "���� Jencode(&A)..."
END

#endif // ����(�л����񹲺͹�) resources
#endif // ����(���壬�й�) resources
/////////////////////////////////////////////////////////////////////////////


Expand Down
Loading

0 comments on commit 3cd0864

Please sign in to comment.