Files
Upsilon/apps/shared/toolbox_helpers.h
Léa Saviot b430cba335 [apps/poincare] Fix "random()" layout creation.
Change-Id: Ic8e12dfba925066fafa172b750162e820eeef82b
2018-04-18 11:26:21 +02:00

28 lines
1010 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, bool replaceArgsWithEmptyChar = false);
void TextToInsertForCommandText(const char * command, char * buffer, int bufferSize, bool replaceArgsWithEmptyChar = false);
/* 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