Added convenience formatting function for image types.
This commit is contained in:
parent
37ddff87ec
commit
3d09339ddd
@ -109,3 +109,28 @@ UiUtils::FunctionNameForFrame(StackFrame* frame, char* buffer,
|
|||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*static*/ const char*
|
||||||
|
UiUtils::ImageTypeToString(image_type type, char* buffer, size_t bufferSize)
|
||||||
|
{
|
||||||
|
switch (type) {
|
||||||
|
case B_APP_IMAGE:
|
||||||
|
snprintf(buffer, bufferSize, "Application");
|
||||||
|
break;
|
||||||
|
case B_LIBRARY_IMAGE:
|
||||||
|
snprintf(buffer, bufferSize, "Library");
|
||||||
|
break;
|
||||||
|
case B_ADD_ON_IMAGE:
|
||||||
|
snprintf(buffer, bufferSize, "Add-on");
|
||||||
|
break;
|
||||||
|
case B_SYSTEM_IMAGE:
|
||||||
|
snprintf(buffer, bufferSize, "System");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
snprintf(buffer, bufferSize, "Unknown");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
|
|
||||||
#include <size_t.h>
|
#include <size_t.h>
|
||||||
|
|
||||||
|
#include <image.h>
|
||||||
class StackFrame;
|
|
||||||
|
|
||||||
|
|
||||||
class BVariant;
|
class BVariant;
|
||||||
|
class StackFrame;
|
||||||
|
|
||||||
|
|
||||||
class UiUtils {
|
class UiUtils {
|
||||||
@ -23,6 +23,8 @@ public:
|
|||||||
char* buffer, size_t bufferSize);
|
char* buffer, size_t bufferSize);
|
||||||
static const char* FunctionNameForFrame(StackFrame* frame,
|
static const char* FunctionNameForFrame(StackFrame* frame,
|
||||||
char* buffer, size_t bufferSize);
|
char* buffer, size_t bufferSize);
|
||||||
|
static const char* ImageTypeToString(image_type type,
|
||||||
|
char* buffer, size_t bufferSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user