Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem_Warning_Fixed
Diff: FileSelectorWav.cpp
- Revision:
- 3:dd3b8a21417b
- Parent:
- 2:511479736d6e
- Child:
- 5:7c8f0fc9dfb6
--- a/FileSelectorWav.cpp Sun Oct 02 03:26:52 2016 +0000
+++ b/FileSelectorWav.cpp Wed Nov 02 12:59:58 2016 +0000
@@ -2,7 +2,7 @@
// FileSelector class
// SD カード内のファイル名の一覧を表示し,ファイルを選択する
//
-// 2016/10/02, Copyright (c) 2016 MIKAMI, Naoki
+// 2016/11/02, Copyright (c) 2016 MIKAMI, Naoki
//--------------------------------------------------------------
#include "FileSelectorWav.hpp"
@@ -135,7 +135,8 @@
string FileSelector::GetFileNameNoExt(int n)
{
string name = fileNames_[n];
- name.erase(name.find("."));
- return name.substr(0, MAX_NAME_LENGTH_);
+ int k = name.rfind(".");
+ if (k != string::npos) return name.erase(k);
+ else return name;
}
}