Files
Upsilon/apps/shared/toolbox_helpers.h
Léa Saviot f3e6b10410 [apps/math_toolbox] Handle const char * when selecting a leaf.
Else, there would be a problem with sequence_toolbox, where not all
toolbox leaves are message trees.

Change-Id: Ib4968aad37f6a835b1ea4d77efac2ae1bd19c7ce
2018-01-19 17:04:41 +01:00

28 lines
932 B
C++

#ifndef SHARED_TOOLBOX_HELPERS_H
#define SHARED_TOOLBOX_HELPERS_H
#include <escher/i18n.h>
namespace Shared {
namespace ToolboxHelpers {
int CursorIndexInCommandText(const char * text);
/* Returns the index of the cursor position in a command, which is the smallest
* index between :
* - After the first open parenthesis
* - The end of the text */
void TextToInsertForCommandMessage(I18n::Message message, char * buffer, int bufferSize);
void TextToInsertForCommandText(const char * command, char * buffer, int bufferSize);
/* Removes the arguments from a command:
* - Removes text between parentheses or brackets, except commas */
void TextToParseIntoLayoutForCommandMessage(I18n::Message message, char * buffer, int bufferSize);
void TextToParseIntoLayoutForCommandText(const char * command, char * buffer, int bufferSize);
/* Removes the arguments from a command and replaces them with empty chars. */
}
}
#endif