summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2021-02-04 11:15:36 -0600
committerJeff Hatch <jhatch@multitech.com>2021-02-04 11:15:36 -0600
commit790f535aa15e9d149d742bada1e25358d381b5f6 (patch)
tree23ff6a85c500444f942a7bf356fb08793531f9a5 /src
parent7ba216743f5a413ff3093cfe169718894836cb62 (diff)
parentda261ffdee9e0a49d1e3ec9e06fa3b6828596dd5 (diff)
downloadlibmts-790f535aa15e9d149d742bada1e25358d381b5f6.tar.gz
libmts-790f535aa15e9d149d742bada1e25358d381b5f6.tar.bz2
libmts-790f535aa15e9d149d742bada1e25358d381b5f6.zip
Merge branch 'ms/MTX-3785_file_type_restrictions' into 'master' 0.9
[MTX-3785] mPower R.5.4: GP-971 - Device shall implement file type restrictions for all “upload” sections on the UI See merge request !3
Diffstat (limited to 'src')
-rw-r--r--src/MTS_Text.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/MTS_Text.cpp b/src/MTS_Text.cpp
index d823bfe..8672acb 100644
--- a/src/MTS_Text.cpp
+++ b/src/MTS_Text.cpp
@@ -699,3 +699,10 @@ bool Text::parseHex(uint64_t& value, const std::string& str) {
return ((uint8_t) ss.rdstate() == RDSTATE_SUCCESS_MASK);
}
+std::string Text::getFileExtension(const std::string& filename) {
+ size_t pos = filename.rfind('.', filename.length());
+ if (pos != std::string::npos) {
+ return (filename.substr(pos + 1));
+ }
+ return ("");
+}