Skip to content

Commit ee8d37a

Browse files
indent code
1 parent eebd68c commit ee8d37a

19 files changed

+81
-77
lines changed

modules/audio/builtin/cpp/Gateway.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ static const nlsGateway gateway[] =
6868
{ "audioplayer_stop", Nelson::AudioGateway::audioplayer_stopBuiltin, 0, 1 },
6969
{ "audioplayer_used", Nelson::AudioGateway::audioplayer_usedBuiltin, 1, 0 },
7070
{ "audioplayer_isprop", Nelson::AudioGateway::audioplayer_ispropBuiltin, 1, 2 },
71-
{ "audioplayer_ismethod", Nelson::AudioGateway::audioplayer_ismethodBuiltin, 1, 2 },
72-
{ "playblocking", Nelson::AudioGateway::playblockingBuiltin, 0, -1 },
71+
{ "audioplayer_ismethod", Nelson::AudioGateway::audioplayer_ismethodBuiltin, 1, 2 },
72+
{ "playblocking", Nelson::AudioGateway::playblockingBuiltin, 0, -1 },
7373
{ "play", Nelson::AudioGateway::playBuiltin, 0, -1 },
7474
{ "stop", Nelson::AudioGateway::stopBuiltin, 0, 1 },
7575
{ "resume", Nelson::AudioGateway::resumeBuiltin, 0, 1 },

modules/audio/src/cpp/AudioplayerObject.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,12 @@ namespace Nelson {
258258
return (it != propertiesNames.end());
259259
}
260260
//=============================================================================
261-
bool AudioplayerObject::isMethod(std::wstring propertyName)
262-
{
263-
return false;
264-
}
265-
//=============================================================================
266-
bool AudioplayerObject::get(std::wstring propertyName, ArrayOf &res)
261+
bool AudioplayerObject::isMethod(std::wstring propertyName)
262+
{
263+
return false;
264+
}
265+
//=============================================================================
266+
bool AudioplayerObject::get(std::wstring propertyName, ArrayOf &res)
267267
{
268268
if (propertyName == L"SampleRate")
269269
{

modules/audio/src/include/AudioplayerObject.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace Nelson {
4646
bool disp(Evaluator *eval);
4747
wstringVector fieldnames();
4848
bool isProperty(std::wstring propertyName);
49-
bool isMethod(std::wstring methodName);
49+
bool isMethod(std::wstring methodName);
5050

5151
bool setSamples(ArrayOf data, int SampleRate, std::wstring &errorMessage);
5252
bool setSamples(ArrayOf data, int SampleRate, int BitsPerSample, std::wstring &errorMessage);

modules/com_engine/src/cpp/fieldnamesComHandleObject.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace Nelson {
2727
//=============================================================================
2828
void fieldnamesComHandleObject(ArrayOf A, bool fullList, wstringVector &fieldnames)
2929
{
30-
if (A.getHandleCategory() != COM_CATEGORY_STR)
30+
if (A.getHandleCategory() != COM_CATEGORY_STR)
3131
{
3232
throw Exception(_W("COM handle expected."));
3333
}

modules/dynamic_link/builtin/cpp/Gateway.cpp

+15-15
Original file line numberDiff line numberDiff line change
@@ -71,35 +71,35 @@ static const nlsGateway gateway[] =
7171
{ "dlsym_disp", Nelson::DynamicLinkGateway::dlsym_dispBuiltin, 0, 1 },
7272
{ "dlsym_get", Nelson::DynamicLinkGateway::dlsym_getBuiltin, 1, 2 },
7373
{ "dlsym_isprop", Nelson::DynamicLinkGateway::dlsym_ispropBuiltin, 1, 2 },
74-
{ "dlsym_ismethod", Nelson::DynamicLinkGateway::dlsym_ismethodBuiltin, 1, 2 },
75-
{ "dlsym_fieldnames", Nelson::DynamicLinkGateway::dlsym_fieldnamesBuiltin, 1, 1 },
76-
{ "dlsym_used", Nelson::DynamicLinkGateway::dlsym_usedBuiltin, 1, 0 },
77-
{ "dlsym_delete", Nelson::DynamicLinkGateway::dlsym_deleteBuiltin, 0, 1 },
78-
{ "dlsym_isvalid", Nelson::DynamicLinkGateway::dlsym_isvalidBuiltin, 1, 1 },
79-
{ "dllib_disp", Nelson::DynamicLinkGateway::dllib_dispBuiltin, 0, 1 },
74+
{ "dlsym_ismethod", Nelson::DynamicLinkGateway::dlsym_ismethodBuiltin, 1, 2 },
75+
{ "dlsym_fieldnames", Nelson::DynamicLinkGateway::dlsym_fieldnamesBuiltin, 1, 1 },
76+
{ "dlsym_used", Nelson::DynamicLinkGateway::dlsym_usedBuiltin, 1, 0 },
77+
{ "dlsym_delete", Nelson::DynamicLinkGateway::dlsym_deleteBuiltin, 0, 1 },
78+
{ "dlsym_isvalid", Nelson::DynamicLinkGateway::dlsym_isvalidBuiltin, 1, 1 },
79+
{ "dllib_disp", Nelson::DynamicLinkGateway::dllib_dispBuiltin, 0, 1 },
8080
{ "dllib_get", Nelson::DynamicLinkGateway::dllib_getBuiltin, 1, 2 },
8181
{ "dllib_isprop", Nelson::DynamicLinkGateway::dllib_ispropBuiltin, 1, 2 },
82-
{ "dllib_ismethod", Nelson::DynamicLinkGateway::dllib_ismethodBuiltin, 1, 2 },
83-
{ "dllib_used", Nelson::DynamicLinkGateway::dllib_usedBuiltin, 1, 0 },
82+
{ "dllib_ismethod", Nelson::DynamicLinkGateway::dllib_ismethodBuiltin, 1, 2 },
83+
{ "dllib_used", Nelson::DynamicLinkGateway::dllib_usedBuiltin, 1, 0 },
8484
{ "dllib_delete", Nelson::DynamicLinkGateway::dlcloseBuiltin, 0, 1 },
8585
{ "dllib_isvalid", Nelson::DynamicLinkGateway::dllib_isvalidBuiltin, 1, 1 },
8686
{ "dllib_fieldnames", Nelson::DynamicLinkGateway::dllib_fieldnamesBuiltin, 1, 1 },
8787
{ "dllibinfo", Nelson::DynamicLinkGateway::dllibinfoBuiltin, 1, 1 },
8888
{ "dlcall", Nelson::DynamicLinkGateway::dlcallBuiltin, -1, -1 },
89-
{ "libpointer", Nelson::DynamicLinkGateway::libpointerBuiltin, 1, -1 },
89+
{ "libpointer", Nelson::DynamicLinkGateway::libpointerBuiltin, 1, -1 },
9090
{ "libpointer_disp", Nelson::DynamicLinkGateway::libpointer_dispBuiltin, 0, 1 },
9191
{ "libpointer_isNull", Nelson::DynamicLinkGateway::libpointer_isNullBuiltin, 1, 1 },
9292
{ "libpointer_reshape", Nelson::DynamicLinkGateway::libpointer_reshapeBuiltin, 0, 3 },
9393
{ "libpointer_get", Nelson::DynamicLinkGateway::libpointer_getBuiltin, 1, -1 },
94-
{ "libpointer_isprop", Nelson::DynamicLinkGateway::libpointer_ispropBuiltin, 1, 2 },
95-
{ "libpointer_ismethod", Nelson::DynamicLinkGateway::libpointer_ismethodBuiltin, 1, 2 },
94+
{ "libpointer_isprop", Nelson::DynamicLinkGateway::libpointer_ispropBuiltin, 1, 2 },
95+
{ "libpointer_ismethod", Nelson::DynamicLinkGateway::libpointer_ismethodBuiltin, 1, 2 },
9696
{ "libpointer_plus", Nelson::DynamicLinkGateway::libpointer_plusBuiltin, 1, 2 },
9797
{ "libpointer_setdatatype", Nelson::DynamicLinkGateway::libpointer_setdatatypeBuiltin, 0, 2 },
9898
{ "libpointer_used", Nelson::DynamicLinkGateway::libpointer_usedBuiltin, 1, 0 },
99-
{ "libpointer_delete", Nelson::DynamicLinkGateway::libpointer_deleteBuiltin, 0, 1 },
100-
{ "libpointer_fieldnames", Nelson::DynamicLinkGateway::libpointer_fieldnamesBuiltin, 1, 1 },
101-
{ "libpointer_isvalid", Nelson::DynamicLinkGateway::libpointer_isvalidBuiltin, 1, 1 },
102-
{ "isNull", Nelson::DynamicLinkGateway::isNullBuiltin, 1, 1 },
99+
{ "libpointer_delete", Nelson::DynamicLinkGateway::libpointer_deleteBuiltin, 0, 1 },
100+
{ "libpointer_fieldnames", Nelson::DynamicLinkGateway::libpointer_fieldnamesBuiltin, 1, 1 },
101+
{ "libpointer_isvalid", Nelson::DynamicLinkGateway::libpointer_isvalidBuiltin, 1, 1 },
102+
{ "isNull", Nelson::DynamicLinkGateway::isNullBuiltin, 1, 1 },
103103
{ "getdynlibext", Nelson::DynamicLinkGateway::getdynlibextBuiltin, 1, 0 }
104104
};
105105
//=============================================================================

modules/dynamic_link/builtin/cpp/dllib_deleteBuiltin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ArrayOfVector Nelson::DynamicLinkGateway::dllib_deleteBuiltin(Evaluator* eval, i
3636
ArrayOf param1 = argIn[0];
3737
if (param1.isHandle())
3838
{
39-
DeleteDynamicLinkLibraryObject(param1);
39+
DeleteDynamicLinkLibraryObject(param1);
4040
}
4141
return retval;
4242
}

modules/dynamic_link/builtin/cpp/dllib_dispBuiltin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ArrayOfVector Nelson::DynamicLinkGateway::dllib_dispBuiltin(Evaluator* eval, int
5252
{
5353
Error(eval, _W("dllib handle expected."));
5454
}
55-
DynamicLinkLibraryObject *dllibObj = (DynamicLinkLibraryObject *)param1.getContentAsHandleScalar();
55+
DynamicLinkLibraryObject *dllibObj = (DynamicLinkLibraryObject *)param1.getContentAsHandleScalar();
5656
dllibObj->disp(eval);
5757
}
5858
}

modules/dynamic_link/builtin/cpp/libpointer_deleteBuiltin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ArrayOfVector Nelson::DynamicLinkGateway::libpointer_deleteBuiltin(Evaluator* ev
3636
ArrayOf param1 = argIn[0];
3737
if (param1.isHandle())
3838
{
39-
DeleteLibPointerObject(param1);
39+
DeleteLibPointerObject(param1);
4040
}
4141
return retval;
4242
}

modules/dynamic_link/src/cpp/DeleteLibPointerObject.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace Nelson {
4141
{
4242
throw Exception(_W("libpointer handle expected."));
4343
}
44-
LibPointerObject *obj = (LibPointerObject*)hlObj;
44+
LibPointerObject *obj = (LibPointerObject*)hlObj;
4545
delete obj;
4646
HandleManager::getInstance()->removeHandle(hl);
4747
res = true;

modules/dynamic_link/src/cpp/DynamicLinkLibraryObject.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ namespace Nelson {
116116
auto it = std::find(_propertiesNames.begin(), _propertiesNames.end(), propertyName);
117117
return (it != _propertiesNames.end());
118118
}
119-
//=============================================================================
120-
bool DynamicLinkLibraryObject::isMethod(std::wstring propertyName)
121-
{
122-
return false;
123-
}
119+
//=============================================================================
120+
bool DynamicLinkLibraryObject::isMethod(std::wstring propertyName)
121+
{
122+
return false;
123+
}
124124
//=============================================================================
125125
bool DynamicLinkLibraryObject::searchLibrary(std::wstring libraryPath, std::wstring &fullLibraryPath)
126126
{

modules/dynamic_link/src/cpp/DynamicLinkSymbolObject.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,10 @@ namespace Nelson {
637637
return (it != _propertiesNames.end());
638638
}
639639
//=============================================================================
640-
bool DynamicLinkSymbolObject::isMethod(std::wstring methodName)
641-
{
642-
return false;
643-
}
644-
//=============================================================================
640+
bool DynamicLinkSymbolObject::isMethod(std::wstring methodName)
641+
{
642+
return false;
643+
}
644+
//=============================================================================
645645
}
646646
//=============================================================================

modules/dynamic_link/src/include/DynamicLinkLibraryObject.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace Nelson {
4040
bool isWriteableProperty(std::wstring propertyName);
4141
wstringVector fieldnames();
4242
bool isProperty(std::wstring propertyName);
43-
bool isMethod(std::wstring methodName);
43+
bool isMethod(std::wstring methodName);
4444

4545
private:
4646
wstringVector _propertiesNames;

modules/dynamic_link/src/include/DynamicLinkSymbolObject.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace Nelson {
4242
bool isWriteableProperty(std::wstring propertyName);
4343
wstringVector fieldnames();
4444
bool isProperty(std::wstring propertyName);
45-
bool isMethod(std::wstring methodName);
45+
bool isMethod(std::wstring methodName);
4646

4747
private:
4848
ArrayOf _dllibObject;

modules/gui/src/cpp/QtTerminal.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,11 @@ QString QtTerminal::getCurrentCommandLine()
441441
QTextBlock curBlock = promptBlock;
442442
while (curBlock != document()->lastBlock())
443443
{
444-
if (!curBlock.isValid())
445-
{
446-
command.clear();
447-
break;
448-
}
444+
if (!curBlock.isValid())
445+
{
446+
command.clear();
447+
break;
448+
}
449449
command = command.append(curBlock.text());
450450
command = command.append("\n");
451451
curBlock = curBlock.next();

modules/handle/builtin/cpp/handle_fieldnamesBuiltin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ArrayOfVector Nelson::HandleGateway::handle_fieldnamesBuiltin(Evaluator* eval, i
3636
Error(eval, ERROR_WRONG_NUMBERS_OUTPUT_ARGS);
3737
}
3838
ArrayOf param1 = argIn[0];
39-
std::wstring handleTypeName = param1.getHandleCategory();
39+
std::wstring handleTypeName = param1.getHandleCategory();
4040
if (handleTypeName == utf8_to_wstring(NLS_HANDLE_STR) || handleTypeName == L"")
4141
{
4242
Error(eval, _W("Invalid handle."));

modules/interpreter/src/cpp/Evaluator.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -4148,14 +4148,14 @@ namespace Nelson {
41484148
logical isValidMethod = false;
41494149
try
41504150
{
4151-
isValidMethod = r.isHandleMethod(utf8_to_wstring(fieldname));
4151+
isValidMethod = r.isHandleMethod(utf8_to_wstring(fieldname));
41524152
}
41534153
catch (Exception)
41544154
{
4155-
if (r.isHandle())
4156-
{
4157-
throw Exception(_W("Please define: ") + r.getHandleCategory() + L"_ismethod");
4158-
}
4155+
if (r.isHandle())
4156+
{
4157+
throw Exception(_W("Please define: ") + r.getHandleCategory() + L"_ismethod");
4158+
}
41594159
isValidMethod = false;
41604160
}
41614161
if (isValidMethod)
@@ -4750,7 +4750,7 @@ namespace Nelson {
47504750
{
47514751
Error(this, _W("Right hand values must satisfy left hand side expression."));
47524752
}
4753-
std::wstring currentType = r.getHandleCategory();
4753+
std::wstring currentType = r.getHandleCategory();
47544754
std::wstring ufunctionNameSetHandle = currentType + L"_set";
47554755
std::string functionNameSetHandle = wstring_to_utf8(ufunctionNameSetHandle);
47564756
Context *context = this->getContext();
@@ -4774,7 +4774,7 @@ namespace Nelson {
47744774
ArrayOfVector Evaluator::getHandle(ArrayOf r, std::string fieldname, ArrayOfVector params)
47754775
{
47764776
ArrayOfVector argIn;
4777-
std::wstring currentType = r.getHandleCategory();
4777+
std::wstring currentType = r.getHandleCategory();
47784778
Context *context = this->getContext();
47794779
FunctionDef *funcDef = nullptr;
47804780
std::string functionNameCurrentType = wstring_to_utf8(currentType) + "_" + fieldname;

modules/types/src/cpp/ArrayOf_HandleType.cpp

+18-18
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,23 @@ namespace Nelson {
6363
return HandleManager::getInstance()->getPointer(hl);
6464
}
6565
//=============================================================================
66-
bool ArrayOf::isHandleProperty(std::wstring propertyName) const
67-
{
68-
HandleGenericObject *obj = getContentAsHandleScalar();
69-
return obj->isProperty(propertyName);
70-
}
71-
//=============================================================================
72-
bool ArrayOf::isHandleMethod(std::wstring methodName) const
73-
{
74-
HandleGenericObject *obj = getContentAsHandleScalar();
75-
return obj->isMethod(methodName);
76-
}
77-
//=============================================================================
78-
std::wstring ArrayOf::getHandleCategory() const
79-
{
80-
HandleGenericObject *obj = getContentAsHandleScalar();
81-
return obj->getCategory();
82-
}
83-
//=============================================================================
66+
bool ArrayOf::isHandleProperty(std::wstring propertyName) const
67+
{
68+
HandleGenericObject *obj = getContentAsHandleScalar();
69+
return obj->isProperty(propertyName);
70+
}
71+
//=============================================================================
72+
bool ArrayOf::isHandleMethod(std::wstring methodName) const
73+
{
74+
HandleGenericObject *obj = getContentAsHandleScalar();
75+
return obj->isMethod(methodName);
76+
}
77+
//=============================================================================
78+
std::wstring ArrayOf::getHandleCategory() const
79+
{
80+
HandleGenericObject *obj = getContentAsHandleScalar();
81+
return obj->getCategory();
82+
}
83+
//=============================================================================
8484
}
8585
//=============================================================================

modules/types/src/include/ArrayOf.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,9 @@ namespace Nelson {
947947
const bool isHandle() const;
948948
static ArrayOf handleConstructor(HandleGenericObject *ptr);
949949
static ArrayOf handleConstructor(nelson_handle hl);
950-
bool isHandleProperty(std::wstring propertyName) const;
951-
bool isHandleMethod(std::wstring methodName) const;
952-
std::wstring getHandleCategory() const;
950+
bool isHandleProperty(std::wstring propertyName) const;
951+
bool isHandleMethod(std::wstring methodName) const;
952+
std::wstring getHandleCategory() const;
953953

954954
HandleGenericObject *getContentAsHandleScalar() const;
955955
};

modules/types/src/include/HandleGenericObject.hpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ namespace Nelson {
3535
void setPointer(void *_ptr);
3636
void *getPointer();
3737
bool isScoped();
38-
virtual bool isProperty(std::wstring propertyName) { return false; };
39-
virtual bool isMethod(std::wstring methodName) { return false; };
38+
virtual bool isProperty(std::wstring propertyName) {
39+
return false;
40+
};
41+
virtual bool isMethod(std::wstring methodName) {
42+
return false;
43+
};
4044

4145
};
4246
//=============================================================================

0 commit comments

Comments
 (0)