⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 print.cpp

📁 DVD
💻 CPP
字号:
// **********************************************************************
//  This file is a part of MaBreakers
//  Common MTK Package
// **********************************************************************
//
//  Copyright (C) 2006 MaBreaker
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
//  02110-1301, USA.
//
// **********************************************************************

#include <stdio.h>
#include <string.h>
#include <ctype.h>

#include "Print.h"

// **********************************************************************
TPrint *Print;
// **********************************************************************

TPrint::TPrint(char *sText)
{
    printf("%s", sText);
}

void TPrint::Main(char *sText)
{
    printf("%s\n", sText);
}

void TPrint::Int(char *sText, int i)
{
    printf("%s%i\n", sText, i);
}

void TPrint::Hex(char *sText, ulong h)
{
    printf("%s0x%H\n", sText, h);
}

void TPrint::Head(char *sText)
{

    int i;

    i = 0;

    while(sText[i] != 0x00)
    {
        // To upper
        if((sText[i] > 0x60) && (sText[i] < 0x7B))
        {
            sText[i] = sText[i] - 0x20;
        }
        i++;
    }

    printf("------------------------------------------\n");
    printf("%s\n", sText);
    printf("------------------------------------------\n");
}

void TPrint::Log(char *sText)
{
    printf("LOG : %s\n", sText);
};

void TPrint::Chip(uchar bVendor, uchar bType, ulong ulSize, char *Text)
{
    printf("- FLASH CHIP\n");
    printf("   Vendor : 0x%X\n", bVendor);
    printf("   Type   : 0x%X\n", bType);
    printf("   Size   : 0x%lX\n", ulSize);
    printf("   Model  : %s\n", Text);
};

#ifdef _DEBUG
void TPrint::Debug(char *sText)
{
    printf("DEBUG : %s\n", sText);
};
#endif

void TPrint::Warning(char *sText)
{
    fprintf(stderr, "WARNING : %s\n", sText);
}

void TPrint::Error(char *sText, unsigned long ulError)
{
    fprintf(stderr, "ERROR : %s (%d)\n", sText, ulError);
}

void TPrint::ErrorMsg(char *sText, char *sTitle)
{
    fprintf(stderr, "****************************************\n");
    fprintf(stderr, "%s\n", sTitle);
    fprintf(stderr, "----------------------------------------\n");
    fprintf(stderr, "%s\n", sText);
    fprintf(stderr, "****************************************\n");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -