summaryrefslogtreecommitdiff
path: root/include/basic
diff options
context:
space:
mode:
authorGergo Mocsi <gmocsi91@gmail.com>2013-07-19 22:00:29 +0200
committerGergo Mocsi <gmocsi91@gmail.com>2013-09-02 18:16:45 +0200
commit6c1854f9f3f7308dce0e326aa063d929f8da5881 (patch)
treeda87e662a0b6c351098265adc96ae860019e4562 /include/basic
parent5a615ddf3442bf9a5106336fec39e479b50107ea (diff)
GSOC work, code fixes + cache implementation
WARNING: cache implementation gives a link error to it's methods. Created the cache called CodeCompleteDataCache in file include/basic/codecompletecache.hxx This class should replace the std::vector< CodeCompleteData > int file baside2b.cxx When issuing command "make basic", it compiles fine, but, when "make basctl", it gives a link error (ld returned status 1) to CodeCompleteDataCache's methods. Change-Id: If78c6533b7fb5653cc459d22b80c98d097b886eb
Diffstat (limited to 'include/basic')
-rw-r--r--include/basic/codecompletecache.hxx61
-rw-r--r--include/basic/sbmod.hxx7
2 files changed, 66 insertions, 2 deletions
diff --git a/include/basic/codecompletecache.hxx b/include/basic/codecompletecache.hxx
new file mode 100644
index 000000000000..f375f04d0484
--- /dev/null
+++ b/include/basic/codecompletecache.hxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CODECOMPLETECACHE_H
+#define CODECOMPLETECACHE_H
+
+#include <basic/sbdef.hxx>
+#include <basic/sbxobj.hxx>
+#include <basic/sbxdef.hxx>
+#include <boost/utility.hpp>
+#include <boost/unordered_map.hpp>
+#include <rtl/ustring.hxx>
+
+typedef boost::unordered_map< OUString, OUString, OUStringHash > CodeCompleteVarTypes;
+/* variable name, type */
+typedef boost::unordered_map< OUString, CodeCompleteVarTypes, OUStringHash > CodeCompleteVarScopes;
+/* procedure, CodeCompleteVarTypes */
+
+class CodeCompleteDataCache
+{
+/*
+ * cache to store data for
+ * code completition
+ * */
+private:
+ CodeCompleteVarScopes aVarScopes;
+
+public:
+ const OUString GLOB_KEY = OUString("global key");
+ const OUString NOT_FOUND = OUString("not found");
+ CodeCompleteDataCache(){}
+
+ virtual ~CodeCompleteDataCache(){}
+
+ void SetVars( const CodeCompleteVarScopes& aScopes );
+ const CodeCompleteVarScopes& GetVars() const;
+
+ void InsertProcedure( const OUString& sProcName, const CodeCompleteVarTypes& aVarTypes );
+ const OUString& GetVariableType( const OUString& sVarName, const OUString& sProcName ) const;
+
+};
+
+#endif // CODECOMPLETECACHE_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbmod.hxx b/include/basic/sbmod.hxx
index 65dab93173c4..763beefe3c5d 100644
--- a/include/basic/sbmod.hxx
+++ b/include/basic/sbmod.hxx
@@ -29,6 +29,7 @@
#include <deque>
#include <boost/utility.hpp>
#include "basicdllapi.h"
+#include <basic/codecompletecache.hxx>
class SbMethod;
class SbProperty;
@@ -44,6 +45,7 @@ class ModuleInitDependencyMap;
struct ClassModuleRunInitItem;
struct SbClassData;
+/*
struct CodeCompleteData
{
OUString sVarName;
@@ -59,7 +61,7 @@ struct CodeCompleteData
{
return ( sVarParent == OUString("") );
}
-};
+};*/
class BASIC_DLLPUBLIC SbModule : public SbxObject, private ::boost::noncopyable
{
@@ -150,7 +152,8 @@ public:
void RemoveVars();
::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule();
bool createCOMWrapperForIface( ::com::sun::star::uno::Any& o_rRetAny, SbClassModuleObject* pProxyClassModuleObject );
- std::vector< CodeCompleteData > GetCodeCompleteDataFromParse();
+ //std::vector< CodeCompleteData > GetCodeCompleteDataFromParse();
+ CodeCompleteDataCache GetCodeCompleteDataFromParse();
SbxArrayRef GetMethods();
};