SapFlow Probe
A low-cost HRM probe for measuring a tree's water consumption
sd_log.cpp File Reference
#include "sd_log.h"

Functions

String newfile (String fname, String suffix)
 Avoids file conflicts by renaming. More...
 
String int2str (int32_t x)
 Converts an integer to a string. More...
 

Function Documentation

◆ int2str()

String int2str ( int32_t  x)

Converts an integer to a string.

Parameters
xThe integer
Returns
a string containing a text representation of x

Referenced by delta(), and measure().

◆ newfile()

String newfile ( String  fname,
String  suffix = ".csv" 
)

Avoids file conflicts by renaming.

Checks if the filename exists. If so, appends an integer. For example, if "test.csv" and "test(01).csv" are present in the file system and you call String x = newfile("test"); x will contain the string "test(02).csv"

Parameters
fnameThe desired file name (without the extension)
suffixThe file extension
Returns
the new filename it came up with.

References sd.