Ignore:
Timestamp:
04/22/15 04:14:59 (9 years ago)
Author:
sz
Message:

Renamed some classes and functions to make their purpose more obvious:

All MessageHandlers? must now be given the explicit "Enable" argument if you want them to automatically become active. This makes side effects clearly visible.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • cpp/common/hmessage.cpp

    r371 r372  
    33// See LICENSE.txt for details.
    44
    5 #include "framsg.h"
     5#include "hmessage.h"
    66#include <common/nonstd_stdio.h>
    77#include "stl-util.h"
    88#include "Convert.h"
    99
    10 const char* MSG_LEVEL[]={"[DEBUG] ","","[WARN] ","[ERROR] ","[CRITICAL] "};
     10const char* HMSG_LEVEL[]={"[DEBUG] ","","[WARN] ","[ERROR] ","[CRITICAL] "};
    1111
    12 void FramMessage(const char *o, const char *m, const char *txt, int w)
     12void Hmessage(const char *o, const char *m, const char *txt, int w)
    1313{
    1414        int line = 0; //all lines except the first one get the "..." prefix
     
    2424                {
    2525                        if (*nextsep == 0) //there was only one line! no need to modify it in any way.
    26                                 _FramMessageSingleLine(o, m, txt, w);
     26                                _HmessageSingleLine(o, m, txt, w);
    2727                        else //first line from multi-line
    28                                 _FramMessageSingleLine(o, m, string(txt, nextsep - txt).c_str(), w);
     28                                _HmessageSingleLine(o, m, string(txt, nextsep - txt).c_str(), w);
    2929                }
    3030                else //consecutive lines from multi-line
    31                         _FramMessageSingleLine(o, m, (FRAMSG_MULTILINE_CONTINUATION + string(txt, nextsep - txt)).c_str(), w); //could also add line numbers like ...(3)... but let's keep the prefix short and simple
     31                        _HmessageSingleLine(o, m, (HMSG_MULTILINE_CONTINUATION + string(txt, nextsep - txt)).c_str(), w); //could also add line numbers like ...(3)... but let's keep the prefix short and simple
    3232                line++;
    3333                if ((nextsep[0] == '\r') && (nextsep[1] == '\n'))
     
    3939
    4040
    41 void FMprintf_va(const char *o,const char *m,int w,const char *bl,va_list va)
     41void Hprintf_va(const char *o,const char *m,int w,const char *bl,va_list va)
    4242{
    4343        string buf=ssprintf_va(bl,va);
    44         FramMessage(o,m,buf.c_str(),w);
     44        Hmessage(o,m,buf.c_str(),w);
    4545}
    4646
    47 void FMprintf(const char *o,const char *m,int w,const char *bl, ...)
     47void Hprintf(const char *o,const char *m,int w,const char *bl, ...)
    4848{
    4949        va_list argptr;
    5050        va_start(argptr,bl);
    51         FMprintf_va(o,m,w,bl,argptr);
     51        Hprintf_va(o,m,w,bl,argptr);
    5252        va_end(argptr);
    5353}
    5454
    55 void printFM(const char *bl,...)
     55void printH(const char *bl,...)
    5656{
    5757        va_list argptr;
    5858        va_start(argptr,bl);
    59         FMprintf_va("Message","printf",FMLV_INFO,bl,argptr);
     59        Hprintf_va("Message","printf",HMLV_INFO,bl,argptr);
    6060        va_end(argptr);
    6161}
Note: See TracChangeset for help on using the changeset viewer.